diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 2ffd505394f5..6bb9cdd4ab4f 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -262,6 +262,13 @@ # ServiceLabel: %Cognitive - Speech # ServiceOwners: @rhurey +# PRLabel: %Speech Transcription +/sdk/transcription/azure-ai-speech-transcription/ @amber-yujueWang @rhurey @xitzhang @Azure/azure-java-sdk + +# ServiceLabel: %Speech Transcription +# AzureSdkOwners: @amber-yujueWang @rhurey @xitzhang +# ServiceOwners: @rhurey @xitzhang @amber-yujueWang + # PRLabel: %Cognitive - Text Analytics /sdk/textanalytics/ @samvaity @quentinRobinson @Azure/azure-java-sdk diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index ce5b56587f72..fe95eec5e5ba 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -192,6 +192,18 @@ When facing issues, direct users to: - [GitHub Issues](https://github.com/Azure/azure-sdk-for-java/issues/new/choose) - [Stack Overflow with azure-java-sdk tag](https://stackoverflow.com/questions/tagged/azure-java-sdk) +## Local SDK Generation and Package Lifecycle (TypeSpec) + +### AUTHORITATIVE REFERENCE +For all TypeSpec-based SDK workflows (generation, building, validation, testing, versioning, and release preparation), follow #file:../eng/common/instructions/azsdk-tools/local-sdk-workflow.instructions.md + +### DEFAULT BEHAVIORS +- **Repository:** Use the current workspace as the local SDK repository unless the user specifies a different path. +- **Configuration:** Identify `tsp-location.yaml` from files open in the editor. If unclear, ask the user. + +### REQUIRED CONFIRMATIONS +Ask the user for clarification if repository path or configuration file is ambiguous. + ## SDK release For detailed workflow instructions, see [SDK Release](../eng/common/instructions/copilot/sdk-release.instructions.md). diff --git a/.github/workflows/event-processor.yml b/.github/workflows/event-processor.yml index eabc6e2ee0e7..6cb56cf060a4 100644 --- a/.github/workflows/event-processor.yml +++ b/.github/workflows/event-processor.yml @@ -97,7 +97,7 @@ jobs: LABEL_SERVICE_API_KEY: ${{ env.LABEL_SERVICE_API_KEY }} - name: Archive github event data - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 if: always() with: name: event diff --git a/.github/workflows/post-apiview.yml b/.github/workflows/post-apiview.yml index 4306a63ace13..71678bbb631b 100644 --- a/.github/workflows/post-apiview.yml +++ b/.github/workflows/post-apiview.yml @@ -18,7 +18,7 @@ jobs: contains(github.event.check_run.name, 'Build Analyze') ) steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v6 with: sparse-checkout: 'eng/common' diff --git a/.github/workflows/scheduled-event-processor.yml b/.github/workflows/scheduled-event-processor.yml index 727db15976e2..4e89d44cf0e6 100644 --- a/.github/workflows/scheduled-event-processor.yml +++ b/.github/workflows/scheduled-event-processor.yml @@ -123,7 +123,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Archive github event data - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 if: always() with: name: event diff --git a/.vscode/cspell.json b/.vscode/cspell.json index b692e840c4cc..7c69ad6801ed 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -105,6 +105,7 @@ "sdk/cosmos/azure-cosmos-spark_3-4_2-12/**", "sdk/cosmos/azure-cosmos-spark_3-5/**", "sdk/cosmos/azure-cosmos-spark_3-5_2-12/**", + "sdk/cosmos/azure-cosmos-spark_3-5_2-13/**", "sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/**", "sdk/cosmos/fabric-cosmos-spark-auth_3/**", "sdk/cosmos/azure-cosmos-encryption/**", @@ -437,7 +438,8 @@ "windowtitle", "wordomatic", "xlint", - "XLint" + "XLint", + "xmlparserv" ], "overrides": [ { diff --git a/common/perf-test-core/pom.xml b/common/perf-test-core/pom.xml index 60bf111b8ad7..7bcc6634b5f4 100644 --- a/common/perf-test-core/pom.xml +++ b/common/perf-test-core/pom.xml @@ -55,9 +55,8 @@ com.beust:jcommander:[1.82] - - io.projectreactor:reactor-core:[3.7.11] - io.vertx:vertx-codegen:[4.5.17] + io.vertx:vertx-codegen:[4.5.23] + io.projectreactor:reactor-core:[3.7.14] @@ -95,7 +94,7 @@ io.vertx vertx-codegen - 4.5.17 + 4.5.23 provided diff --git a/eng/.docsettings.yml b/eng/.docsettings.yml index e8bdd397627d..e68c43e623e6 100644 --- a/eng/.docsettings.yml +++ b/eng/.docsettings.yml @@ -78,6 +78,7 @@ known_content_issues: - ['sdk/cosmos/azure-cosmos-spark_3-3_2-12/README.md', '#3113'] - ['sdk/cosmos/azure-cosmos-spark_3-4_2-12/README.md', '#3113'] - ['sdk/cosmos/azure-cosmos-spark_3-5_2-12/README.md', '#3113'] + - ['sdk/cosmos/azure-cosmos-spark_3-5_2-13/README.md', '#3113'] - ['sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/README.md', '#3113'] - ['sdk/cosmos/fabric-cosmos-spark-auth_3/README.md', '#3113'] - ['sdk/cosmos/azure-cosmos-spark_3_2-12/dev/README.md', '#3113'] diff --git a/eng/automation/api-specs.yaml b/eng/automation/api-specs.yaml index 1099611e15fa..5b00ec3e97e2 100644 --- a/eng/automation/api-specs.yaml +++ b/eng/automation/api-specs.yaml @@ -110,6 +110,8 @@ offazurespringboot: service: springappdiscovery operationalinsights: service: loganalytics +operationalinsights/Microsoft.OperationalInsights/OperationalInsights: + service: loganalytics oracle: service: oracledatabase paloaltonetworks: diff --git a/eng/common/instructions/azsdk-tools/create-release-plan.instructions.md b/eng/common/instructions/azsdk-tools/create-release-plan.instructions.md index 29a4264428d2..6d82d3272eca 100644 --- a/eng/common/instructions/azsdk-tools/create-release-plan.instructions.md +++ b/eng/common/instructions/azsdk-tools/create-release-plan.instructions.md @@ -51,6 +51,10 @@ If any details are missing, prompt the user accordingly: - If SDK pull requests exist: - Collect the pull request links from the user - Use `azsdk_link_sdk_pull_request_to_release_plan` to link each SDK pull request to the release plan + > **GitHub CLI Authentication Required:** + > Before running any SDK PR linking steps, ensure you are authenticated with GitHub CLI. + > Run: `gh auth login` + > You can check authentication status with `gh auth status`. - Confirm successful linking for each SDK pull request ## Step 7: Summary diff --git a/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml b/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml index 52379684c4ea..cb29d1312ebd 100644 --- a/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml +++ b/eng/common/pipelines/templates/steps/create-authenticated-npmrc.yml @@ -6,6 +6,9 @@ parameters: - name: CustomCondition type: string default: succeeded() + - name: ServiceConnection + type: string + default: '' steps: - pwsh: | @@ -21,8 +24,10 @@ steps: $content | Out-File '${{ parameters.npmrcPath }}' displayName: 'Create .npmrc' condition: ${{ parameters.CustomCondition }} + - task: npmAuthenticate@0 displayName: Authenticate .npmrc condition: ${{ parameters.CustomCondition }} inputs: workingFile: ${{ parameters.npmrcPath }} + azureDevOpsServiceConnection: ${{ parameters.ServiceConnection }} diff --git a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 index cf763b5bb1cd..3f8c0f63bb43 100755 --- a/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 +++ b/eng/common/scripts/stress-testing/deploy-stress-tests.ps1 @@ -42,5 +42,30 @@ param( . $PSScriptRoot/stress-test-deployment-lib.ps1 +# If there are local changes to values.yaml it's almost certain that the user +# is an admin and has provisioned a new stress cluster but not published a +# new addons chart with the new infra config values. In these cases we should +# just fail, as deploying without the local addons override causes misleading +# errors in the cluster with pods not able to mount storage accounts using the +# old values.yaml reference from the published stress-test-addons helm chart. +if (!$LocalAddonsPath) { + try { + $repoRoot = git -C $PSScriptRoot rev-parse --show-toplevel 2>$null + } catch { + $repoRoot = $null + } + + if ($repoRoot -and (Split-Path $repoRoot -Leaf) -eq "azure-sdk-tools") { + $valuesFile = Join-Path $repoRoot "tools/stress-cluster/cluster/kubernetes/stress-test-addons/values.yaml" + if (Test-Path $valuesFile) { + $valuesStatus = git -C $repoRoot status --porcelain -- $valuesFile + if ($valuesStatus) { + $localAddonsDir = Split-Path $valuesFile -Parent + throw "Detected changes to '$valuesFile' without -LocalAddonsPath. Re-run with '-LocalAddonsPath $localAddonsDir' to apply local addon values." + } + } + } +} + CheckDependencies DeployStressTests @PSBoundParameters diff --git a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 index a9f45a0a9a00..64d850bf896f 100644 --- a/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 +++ b/eng/common/scripts/stress-testing/stress-test-deployment-lib.ps1 @@ -122,21 +122,21 @@ function DeployStressTests( if ($clusterGroup -or $subscription) { Write-Warning "Overriding cluster group and subscription with defaults for 'pg' environment." } - $clusterGroup = 'rg-stress-cluster-pg' + $clusterGroup = 'SSS3PT_rg-stress-cluster-pg' $subscription = 'Azure SDK Test Resources - TME' $tenant = '70a036f6-8e4d-4615-bad6-149c02e7720d' } elseif ($environment -eq 'prod') { if ($clusterGroup -or $subscription) { Write-Warning "Overriding cluster group and subscription with defaults for 'prod' environment." } - $clusterGroup = 'rg-stress-cluster-prod' + $clusterGroup = 'SSS3PT_rg-stress-cluster-prod' $subscription = 'Azure SDK Test Resources - TME' $tenant = '70a036f6-8e4d-4615-bad6-149c02e7720d' } elseif ($environment -eq 'storage') { if ($clusterGroup -or $subscription) { Write-Warning "Overriding cluster group and subscription with defaults for 'storage' environment." } - $clusterGroup = 'rg-stress-cluster-storage' + $clusterGroup = 'SSS3PT_rg-stress-cluster-storage' $subscription = 'Azure SDK Test Resources - TME' $tenant = '72f988bf-86f1-41af-91ab-2d7cd011db47' } elseif (!$clusterGroup -or !$subscription -or $tenant) { diff --git a/eng/emitter-package-lock.json b/eng/emitter-package-lock.json index 947829669c3d..8ad5850746cd 100644 --- a/eng/emitter-package-lock.json +++ b/eng/emitter-package-lock.json @@ -5,16 +5,16 @@ "packages": { "": { "dependencies": { - "@azure-tools/typespec-java": "0.37.3" + "@azure-tools/typespec-java": "0.38.0" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.63.0", - "@azure-tools/typespec-azure-core": "0.63.0", + "@azure-tools/typespec-autorest": "0.63.1", + "@azure-tools/typespec-azure-core": "0.63.1", "@azure-tools/typespec-azure-resource-manager": "0.63.0", "@azure-tools/typespec-azure-rulesets": "0.63.0", - "@azure-tools/typespec-client-generator-core": "0.63.0", + "@azure-tools/typespec-client-generator-core": "0.63.3", "@azure-tools/typespec-liftr-base": "0.11.0", - "@typespec/compiler": "1.7.0", + "@typespec/compiler": "1.7.1", "@typespec/http": "1.7.0", "@typespec/openapi": "1.7.0", "@typespec/rest": "0.77.0", @@ -72,9 +72,9 @@ } }, "node_modules/@azure-tools/typespec-autorest": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.63.0.tgz", - "integrity": "sha512-E04eX5axqua+bVs8QH1z74Wrq+XjO6tInq6d6EhjBNQAcRyFCJNxJHqcJkzMWNy1ID/iIGNXyRG/elK2AdegZg==", + "version": "0.63.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-autorest/-/typespec-autorest-0.63.1.tgz", + "integrity": "sha512-Nem51jk2eURxa5PPEEUjdguxAEwNIyxTi3ac/GOo/B3SgwIa3WAOpwWqQPyGLPD2hHRKa2pm9FsPu6aLPmgeCQ==", "license": "MIT", "engines": { "node": ">=20.0.0" @@ -82,7 +82,7 @@ "peerDependencies": { "@azure-tools/typespec-azure-core": "^0.63.0", "@azure-tools/typespec-azure-resource-manager": "^0.63.0", - "@azure-tools/typespec-client-generator-core": "^0.63.0", + "@azure-tools/typespec-client-generator-core": "^0.63.1", "@typespec/compiler": "^1.7.0", "@typespec/http": "^1.7.0", "@typespec/openapi": "^1.7.0", @@ -97,9 +97,9 @@ } }, "node_modules/@azure-tools/typespec-azure-core": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.63.0.tgz", - "integrity": "sha512-FbEmpZSQENzBt/Y8qSF1b98T8CqT3bV7IRV8AGGm/73NQZiWQCm2LvQzR0/lbqGntS2EnSBrt394Kt69wM4ifA==", + "version": "0.63.1", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-azure-core/-/typespec-azure-core-0.63.1.tgz", + "integrity": "sha512-r5bJLDNUYAoP3i6topz3P7Y7vFMig92pO/zUuTgo4Q5hTbFoUgKPBBBmamVSwBh5MO4lMSLekZC3QoEYnsVUDg==", "license": "MIT", "engines": { "node": ">=20.0.0" @@ -147,9 +147,9 @@ } }, "node_modules/@azure-tools/typespec-client-generator-core": { - "version": "0.63.0", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.63.0.tgz", - "integrity": "sha512-zpvFvjCjNW+GWzHBV7vJ2E1PKXrmyNqp7FQiYo/D7PJBVTXNtOyIKqqo043ktAaWihbr8cl5QguuNSoBAKL0+Q==", + "version": "0.63.3", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-client-generator-core/-/typespec-client-generator-core-0.63.3.tgz", + "integrity": "sha512-+ZSajpbwjZgMztgYgszFWzLrhOzjWNW7VEQjWvc7mMBtsF0fDTvB0gGfQlJ81CBM9yudPBW0JpwYrO26NXXk8g==", "license": "MIT", "dependencies": { "change-case": "~5.4.4", @@ -173,9 +173,9 @@ } }, "node_modules/@azure-tools/typespec-java": { - "version": "0.37.3", - "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.37.3.tgz", - "integrity": "sha512-YWnf3kQL0qm+5ajGp2fXyv1mG26l63A8QQfm25wklgyRnLACbCdNqSyneOUsbcvIAh7D5/l1Q/Vg6kABZDTBiQ==", + "version": "0.38.0", + "resolved": "https://registry.npmjs.org/@azure-tools/typespec-java/-/typespec-java-0.38.0.tgz", + "integrity": "sha512-8YYI2EM8LrawEhKIWxZOS+dBdsNf64TLyyHfIDLNz8D7ZS3obNEa1dTgz0t4aLcavItOxzqQTVCjpnF7znsEMw==", "license": "MIT", "dependencies": { "@autorest/codemodel": "~4.20.1", @@ -186,13 +186,13 @@ "node": ">=20.0.0" }, "peerDependencies": { - "@azure-tools/typespec-autorest": ">=0.63.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.63.0 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.63.1 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.63.1 <1.0.0", "@azure-tools/typespec-azure-resource-manager": ">=0.63.0 <1.0.0", "@azure-tools/typespec-azure-rulesets": ">=0.63.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.63.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.63.3 <1.0.0", "@azure-tools/typespec-liftr-base": ">=0.11.0 <1.0.0", - "@typespec/compiler": "^1.7.0", + "@typespec/compiler": "^1.7.1", "@typespec/http": "^1.7.0", "@typespec/openapi": "^1.7.0", "@typespec/rest": ">=0.77.0 <1.0.0", @@ -238,13 +238,13 @@ } }, "node_modules/@inquirer/checkbox": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-5.0.2.tgz", - "integrity": "sha512-iTPV4tMMct7iOpwer5qmTP7gjnk1VQJjsNfAaC2b8Q3qiuHM3K2yjjDr5u1MKfkrvp2JD4Flf8sIPpF21pmZmw==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/checkbox/-/checkbox-5.0.3.tgz", + "integrity": "sha512-xtQP2eXMFlOcAhZ4ReKP2KZvDIBb1AnCfZ81wWXG3DXLVH0f0g4obE0XDPH+ukAEMRcZT0kdX2AS1jrWGXbpxw==", "license": "MIT", "dependencies": { "@inquirer/ansi": "^2.0.2", - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/figures": "^2.0.2", "@inquirer/type": "^4.0.2" }, @@ -261,12 +261,12 @@ } }, "node_modules/@inquirer/confirm": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-6.0.2.tgz", - "integrity": "sha512-A0/13Wyi+8iFeNDX6D4zZYKPoBLIEbE4K/219qHcnpXMer2weWvaTo63+2c7mQPPA206DEMSYVOPnEw3meOlCw==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/confirm/-/confirm-6.0.3.tgz", + "integrity": "sha512-lyEvibDFL+NA5R4xl8FUmNhmu81B+LDL9L/MpKkZlQDJZXzG8InxiqYxiAlQYa9cqLLhYqKLQwZqXmSTqCLjyw==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/type": "^4.0.2" }, "engines": { @@ -282,9 +282,9 @@ } }, "node_modules/@inquirer/core": { - "version": "11.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-11.0.2.tgz", - "integrity": "sha512-lgMRx/n02ciiNELBvFLHtmcjbV5tf5D/I0UYfCg2YbTZWmBZ10/niLd3IjWBxz8LtM27xP+4oLEa06Slmb7p7A==", + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/@inquirer/core/-/core-11.1.0.tgz", + "integrity": "sha512-+jD/34T1pK8M5QmZD/ENhOfXdl9Zr+BrQAUc5h2anWgi7gggRq15ZbiBeLoObj0TLbdgW7TAIQRU2boMc9uOKQ==", "license": "MIT", "dependencies": { "@inquirer/ansi": "^2.0.2", @@ -308,12 +308,12 @@ } }, "node_modules/@inquirer/editor": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-5.0.2.tgz", - "integrity": "sha512-pXQ4Nf0qmFcJuYB6NlcIIxH6l6zKOwNg1Jh/ZRdKd2dTqBB4OXKUFbFwR2K4LVXVtq15ZFFatBVT+rerYR8hWQ==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/editor/-/editor-5.0.3.tgz", + "integrity": "sha512-wYyQo96TsAqIciP/r5D3cFeV8h4WqKQ/YOvTg5yOfP2sqEbVVpbxPpfV3LM5D0EP4zUI3EZVHyIUIllnoIa8OQ==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/external-editor": "^2.0.2", "@inquirer/type": "^4.0.2" }, @@ -330,12 +330,12 @@ } }, "node_modules/@inquirer/expand": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-5.0.2.tgz", - "integrity": "sha512-siFG1swxfjFIOxIcehtZkh+KUNB/YCpyfHNEGu+nC/SBXIbgUWibvThLn/WesSxLRGOeSKdNKoTm+GQCKFm6Ww==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/expand/-/expand-5.0.3.tgz", + "integrity": "sha512-2oINvuL27ujjxd95f6K2K909uZOU2x1WiAl7Wb1X/xOtL8CgQ1kSxzykIr7u4xTkXkXOAkCuF45T588/YKee7w==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/type": "^4.0.2" }, "engines": { @@ -381,12 +381,12 @@ } }, "node_modules/@inquirer/input": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-5.0.2.tgz", - "integrity": "sha512-hN2YRo1QiEc9lD3mK+CPnTS4TK2RhCMmMmP4nCWwTkmQL2vx9jPJWYk+rbUZpwR1D583ZJk1FI3i9JZXIpi/qg==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/input/-/input-5.0.3.tgz", + "integrity": "sha512-4R0TdWl53dtp79Vs6Df2OHAtA2FVNqya1hND1f5wjHWxZJxwDMSNB1X5ADZJSsQKYAJ5JHCTO+GpJZ42mK0Otw==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/type": "^4.0.2" }, "engines": { @@ -402,12 +402,12 @@ } }, "node_modules/@inquirer/number": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-4.0.2.tgz", - "integrity": "sha512-4McnjTSYrlthNW1ojkkmP75WLRYhQs7GXm6pDDoIrHqJuV5uUYwfdbB0geHdaKMarAqJQgoOVjzIT0jdWCsKew==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/number/-/number-4.0.3.tgz", + "integrity": "sha512-TjQLe93GGo5snRlu83JxE38ZPqj5ZVggL+QqqAF2oBA5JOJoxx25GG3EGH/XN/Os5WOmKfO8iLVdCXQxXRZIMQ==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/type": "^4.0.2" }, "engines": { @@ -423,13 +423,13 @@ } }, "node_modules/@inquirer/password": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-5.0.2.tgz", - "integrity": "sha512-oSDziMKiw4G2e4zS+0JRfxuPFFGh6N/9yUaluMgEHp2/Yyj2JGwfDO7XbwtOrxVrz+XsP/iaGyWXdQb9d8A0+g==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/password/-/password-5.0.3.tgz", + "integrity": "sha512-rCozGbUMAHedTeYWEN8sgZH4lRCdgG/WinFkit6ZPsp8JaNg2T0g3QslPBS5XbpORyKP/I+xyBO81kFEvhBmjA==", "license": "MIT", "dependencies": { "@inquirer/ansi": "^2.0.2", - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/type": "^4.0.2" }, "engines": { @@ -445,21 +445,21 @@ } }, "node_modules/@inquirer/prompts": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-8.0.2.tgz", - "integrity": "sha512-2zK5zY48fZcl6+gG4eqOC/UzZsJckHCRvjXoLuW4D8LKOCVGdcJiSKkLnumSZjR/6PXPINDGOrGHqNxb+sxJDg==", + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@inquirer/prompts/-/prompts-8.1.0.tgz", + "integrity": "sha512-LsZMdKcmRNF5LyTRuZE5nWeOjganzmN3zwbtNfcs6GPh3I2TsTtF1UYZlbxVfhxd+EuUqLGs/Lm3Xt4v6Az1wA==", "license": "MIT", "dependencies": { - "@inquirer/checkbox": "^5.0.2", - "@inquirer/confirm": "^6.0.2", - "@inquirer/editor": "^5.0.2", - "@inquirer/expand": "^5.0.2", - "@inquirer/input": "^5.0.2", - "@inquirer/number": "^4.0.2", - "@inquirer/password": "^5.0.2", - "@inquirer/rawlist": "^5.0.2", - "@inquirer/search": "^4.0.2", - "@inquirer/select": "^5.0.2" + "@inquirer/checkbox": "^5.0.3", + "@inquirer/confirm": "^6.0.3", + "@inquirer/editor": "^5.0.3", + "@inquirer/expand": "^5.0.3", + "@inquirer/input": "^5.0.3", + "@inquirer/number": "^4.0.3", + "@inquirer/password": "^5.0.3", + "@inquirer/rawlist": "^5.1.0", + "@inquirer/search": "^4.0.3", + "@inquirer/select": "^5.0.3" }, "engines": { "node": ">=23.5.0 || ^22.13.0 || ^21.7.0 || ^20.12.0" @@ -474,12 +474,12 @@ } }, "node_modules/@inquirer/rawlist": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-5.0.2.tgz", - "integrity": "sha512-AcNALEdQKUQDeJcpC1a3YC53m1MLv+sMUS+vRZ8Qigs1Yg3Dcdtmi82rscJplogKOY8CXkKW4wvVwHS2ZjCIBQ==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@inquirer/rawlist/-/rawlist-5.1.0.tgz", + "integrity": "sha512-yUCuVh0jW026Gr2tZlG3kHignxcrLKDR3KBp+eUgNz+BAdSeZk0e18yt2gyBr+giYhj/WSIHCmPDOgp1mT2niQ==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/type": "^4.0.2" }, "engines": { @@ -495,12 +495,12 @@ } }, "node_modules/@inquirer/search": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-4.0.2.tgz", - "integrity": "sha512-hg63w5toohdzE65S3LiGhdfIL0kT+yisbZARf7zw65PvyMUTutTN3eMAvD/B6y/25z88vTrB7kSB45Vz5CbrXg==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/search/-/search-4.0.3.tgz", + "integrity": "sha512-lzqVw0YwuKYetk5VwJ81Ba+dyVlhseHPx9YnRKQgwXdFS0kEavCz2gngnNhnMIxg8+j1N/rUl1t5s1npwa7bqg==", "license": "MIT", "dependencies": { - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/figures": "^2.0.2", "@inquirer/type": "^4.0.2" }, @@ -517,13 +517,13 @@ } }, "node_modules/@inquirer/select": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-5.0.2.tgz", - "integrity": "sha512-JygTohvQxSNnvt7IKANVlg/eds+yN5sLRilYeGc4ri/9Aqi/2QPoXBMV5Cz/L1VtQv63SnTbPXJZeCK2pSwsOA==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/@inquirer/select/-/select-5.0.3.tgz", + "integrity": "sha512-M+ynbwS0ecQFDYMFrQrybA0qL8DV0snpc4kKevCCNaTpfghsRowRY7SlQBeIYNzHqXtiiz4RG9vTOeb/udew7w==", "license": "MIT", "dependencies": { "@inquirer/ansi": "^2.0.2", - "@inquirer/core": "^11.0.2", + "@inquirer/core": "^11.1.0", "@inquirer/figures": "^2.0.2", "@inquirer/type": "^4.0.2" }, @@ -616,9 +616,9 @@ } }, "node_modules/@typespec/compiler": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.7.0.tgz", - "integrity": "sha512-KE2t5I7u/33M/nsIxdng06FUPrqaGSbMsSEsv51eMwYnj3v1+Z3qTTX/dxHAXRXHcfadNlX/NtyAKju+pkMTFQ==", + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@typespec/compiler/-/compiler-1.7.1.tgz", + "integrity": "sha512-sb3MEsKjFlAx8ZG484exs5Ec+JwmYf2anJqLjMusrV3rRMUhv3fbEulk9MD+l4eOkBS46VMNGqRu0wTn8suVVA==", "license": "MIT", "dependencies": { "@babel/code-frame": "~7.27.1", @@ -925,9 +925,9 @@ "license": "BSD-3-Clause" }, "node_modules/fastq": { - "version": "1.19.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", - "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==", + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", "license": "ISC", "dependencies": { "reusify": "^1.0.4" diff --git a/eng/emitter-package.json b/eng/emitter-package.json index 5acfee2a87a1..0082113333e3 100644 --- a/eng/emitter-package.json +++ b/eng/emitter-package.json @@ -1,16 +1,16 @@ { "main": "dist/src/index.js", "dependencies": { - "@azure-tools/typespec-java": "0.37.3" + "@azure-tools/typespec-java": "0.38.0" }, "devDependencies": { - "@azure-tools/typespec-autorest": "0.63.0", - "@azure-tools/typespec-azure-core": "0.63.0", + "@azure-tools/typespec-autorest": "0.63.1", + "@azure-tools/typespec-azure-core": "0.63.1", "@azure-tools/typespec-azure-resource-manager": "0.63.0", "@azure-tools/typespec-azure-rulesets": "0.63.0", - "@azure-tools/typespec-client-generator-core": "0.63.0", + "@azure-tools/typespec-client-generator-core": "0.63.3", "@azure-tools/typespec-liftr-base": "0.11.0", - "@typespec/compiler": "1.7.0", + "@typespec/compiler": "1.7.1", "@typespec/http": "1.7.0", "@typespec/openapi": "1.7.0", "@typespec/rest": "0.77.0", diff --git a/eng/pipelines/templates/stages/1es-redirect.yml b/eng/pipelines/templates/stages/1es-redirect.yml index 41e73fddff94..fcc51483d8e9 100644 --- a/eng/pipelines/templates/stages/1es-redirect.yml +++ b/eng/pipelines/templates/stages/1es-redirect.yml @@ -40,6 +40,9 @@ extends: - 1ES.PT.Tag-refs/tags/canary settings: skipBuildTagsForGitHubPullRequests: true + # Set network isolation policy to Preferred to allow access to common public services like GitHub, NuGet, Maven Central, etc. + # https://eng.ms/docs/coreai/devdiv/one-engineering-system-1es/1es-build/cloudbuild/security/1espt-network-isolation#shared-policies-for-common-use-cases + networkIsolationPolicy: Permissive sdl: ${{ if and(eq(variables['Build.DefinitionName'], 'java - core'), eq(variables['Build.SourceBranchName'], 'main'), eq(variables['System.TeamProject'], 'internal')) }}: autobaseline: diff --git a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json index b3cc2b8d46d0..d1a2da8a0c64 100644 --- a/eng/pipelines/templates/stages/cosmos-emulator-matrix.json +++ b/eng/pipelines/templates/stages/cosmos-emulator-matrix.json @@ -71,18 +71,25 @@ "JavaTestVersion": "1.11", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" }, - "Spark 3.5 Integration Tests targeting Cosmos Emulator - Java 8'": { - "ProfileFlag": "-Dspark-e2e_3-5", + "Spark 3.5, Scala 2.12 Integration Tests targeting Cosmos Emulator - Java 8'": { + "ProfileFlag": "-Dspark-e2e_3-5_2-12", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", "JavaTestVersion": "1.8", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" }, - "Spark 3.5 Integration Tests targeting Cosmos Emulator - Java 11'": { - "ProfileFlag": "-Dspark-e2e_3-5", + "Spark 3.5, Scala 2.12 Integration Tests targeting Cosmos Emulator - Java 17'": { + "ProfileFlag": "-Dspark-e2e_3-5_2-12", "PROTOCOLS": "[\"Tcp\"]", "DESIRED_CONSISTENCIES": "[\"Session\"]", - "JavaTestVersion": "1.11", + "JavaTestVersion": "1.17", + "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" + }, + "Spark 3.5, Scala 2.13 Integration Tests targeting Cosmos Emulator - Java 17'": { + "ProfileFlag": "-Dspark-e2e_3-5_2-13", + "PROTOCOLS": "[\"Tcp\"]", + "DESIRED_CONSISTENCIES": "[\"Session\"]", + "JavaTestVersion": "1.17", "AdditionalArgs": "-DACCOUNT_HOST=https://localhost:8081/ -Dhadoop.home.dir=D:/Hadoop -DCOSMOS.AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY=true" }, "Kafka Integration Tests targeting Cosmos Emulator - Java 11": { diff --git a/eng/versioning/external_dependencies.txt b/eng/versioning/external_dependencies.txt index ee3006837816..1243039d504c 100644 --- a/eng/versioning/external_dependencies.txt +++ b/eng/versioning/external_dependencies.txt @@ -36,31 +36,31 @@ com.microsoft.sqlserver:mssql-jdbc;10.2.3.jre8 com.microsoft.azure:azure-functions-maven-plugin;1.30.0 com.microsoft.azure.functions:azure-functions-java-library;2.2.0 com.mysql:mysql-connector-j;9.0.0 -com.openai:openai-java;4.6.1 +com.openai:openai-java;4.14.0 com.squareup.okhttp3:okhttp;4.12.0 commons-codec:commons-codec;1.15 commons-net:commons-net;3.9.0 io.cloudevents:cloudevents-api;2.2.0 io.cloudevents:cloudevents-core;2.2.0 io.fabric8:kubernetes-client;6.12.1 -io.netty:netty-buffer;4.1.127.Final -io.netty:netty-common;4.1.127.Final -io.netty:netty-codec;4.1.127.Final -io.netty:netty-codec-http;4.1.127.Final -io.netty:netty-codec-http2;4.1.127.Final -io.netty:netty-handler;4.1.127.Final -io.netty:netty-handler-proxy;4.1.127.Final -io.netty:netty-resolver;4.1.127.Final -io.netty:netty-resolver-dns;4.1.127.Final +io.netty:netty-buffer;4.1.130.Final +io.netty:netty-common;4.1.130.Final +io.netty:netty-codec;4.1.130.Final +io.netty:netty-codec-http;4.1.130.Final +io.netty:netty-codec-http2;4.1.130.Final +io.netty:netty-handler;4.1.130.Final +io.netty:netty-handler-proxy;4.1.130.Final +io.netty:netty-resolver;4.1.130.Final +io.netty:netty-resolver-dns;4.1.130.Final io.netty:netty-tcnative-boringssl-static;2.0.74.Final -io.netty:netty-transport;4.1.127.Final -io.netty:netty-transport-native-epoll;4.1.127.Final -io.netty:netty-transport-native-unix-common;4.1.127.Final -io.netty:netty-transport-native-kqueue;4.1.127.Final -io.projectreactor.netty:reactor-netty-http;1.2.10 -io.projectreactor:reactor-core;3.7.11 -io.vertx:vertx-codegen;4.5.17 -io.vertx:vertx-core;4.5.17 +io.netty:netty-transport;4.1.130.Final +io.netty:netty-transport-native-epoll;4.1.130.Final +io.netty:netty-transport-native-unix-common;4.1.130.Final +io.netty:netty-transport-native-kqueue;4.1.130.Final +io.projectreactor.netty:reactor-netty-http;1.2.13 +io.projectreactor:reactor-core;3.7.14 +io.vertx:vertx-codegen;4.5.23 +io.vertx:vertx-core;4.5.23 javax.websocket:javax.websocket-api;1.1 org.apache.commons:commons-compress;1.26.0 org.apache.ant:ant;1.10.15 @@ -256,8 +256,11 @@ cosmos-spark_3-3_org.apache.spark:spark-hive_2.12;3.3.0 cosmos-spark_3-4_org.apache.spark:spark-hive_2.12;3.4.0 cosmos-spark_3-5_org.apache.spark:spark-hive_2.12;3.5.0 cosmos_org.scala-lang:scala-library;2.12.19 -cosmos_org.scala-lang.modules:scala-java8-compat_2.12;0.8.0 +cosmos-scala213_org.scala-lang:scala-library;2.13.17 +cosmos_org.scala-lang.modules:scala-java8-compat_2.12;0.9.1 +cosmos-scala213_org.scala-lang.modules:scala-java8-compat_2.13;0.9.1 cosmos_io.projectreactor:reactor-scala-extensions_2.12;0.8.0 +cosmos-scala213_io.projectreactor:reactor-scala-extensions_2.13;0.8.0 cosmos_commons-io:commons-io;2.4 cosmos_com.microsoft.azure:applicationinsights-core;2.6.4 cosmos_io.micrometer:micrometer-core;1.15.1 @@ -266,9 +269,13 @@ cosmos_io.micrometer:micrometer-registry-graphite;1.15.1 # Cosmos Spark connector tests only cosmos_org.scalatest:scalatest_2.12;3.2.2 +cosmos-scala213_org.scalatest:scalatest_2.13;3.2.2 cosmos_org.scalatest:scalatest-flatspec_2.12;3.2.3 +cosmos-scala213_org.scalatest:scalatest-flatspec_2.13;3.2.3 cosmos_org.scalactic:scalactic_2.12;3.2.3 +cosmos-scala213_org.scalactic:scalactic_2.13;3.2.3 cosmos_org.scalamock:scalamock_2.12;5.0.0 +cosmos-scala213_org.scalamock:scalamock_2.13;5.0.0 cosmos_com.globalmentor:hadoop-bare-naked-local-fs;0.1.0 cosmos_org.mockito:mockito-core;4.8.1 @@ -299,103 +306,103 @@ storage_com.microsoft.azure:azure-storage;8.6.6 # sdk\spring\pom.xml modules springboot3_com.diffplug.spotless:spotless-maven-plugin;2.30.0 -springboot3_com.fasterxml.jackson.core:jackson-annotations;2.19.2 -springboot3_com.fasterxml.jackson.core:jackson-core;2.19.2 -springboot3_com.fasterxml.jackson.core:jackson-databind;2.19.2 -springboot3_com.fasterxml.jackson.dataformat:jackson-dataformat-xml;2.19.2 -springboot3_com.fasterxml.jackson.datatype:jackson-datatype-jdk8;2.19.2 -springboot3_com.fasterxml.jackson.datatype:jackson-datatype-jsr310;2.19.2 -springboot3_com.fasterxml.jackson.module:jackson-module-afterburner;2.19.2 -springboot3_com.fasterxml.jackson.module:jackson-module-parameter-names;2.19.2 +springboot3_com.fasterxml.jackson.core:jackson-annotations;2.19.4 +springboot3_com.fasterxml.jackson.core:jackson-core;2.19.4 +springboot3_com.fasterxml.jackson.core:jackson-databind;2.19.4 +springboot3_com.fasterxml.jackson.dataformat:jackson-dataformat-xml;2.19.4 +springboot3_com.fasterxml.jackson.datatype:jackson-datatype-jdk8;2.19.4 +springboot3_com.fasterxml.jackson.datatype:jackson-datatype-jsr310;2.19.4 +springboot3_com.fasterxml.jackson.module:jackson-module-afterburner;2.19.4 +springboot3_com.fasterxml.jackson.module:jackson-module-parameter-names;2.19.4 springboot3_com.github.spotbugs:spotbugs-maven-plugin;4.8.2.0 springboot3_com.google.code.findbugs:jsr305;3.0.2 -springboot3_com.mysql:mysql-connector-j;9.4.0 +springboot3_com.mysql:mysql-connector-j;9.5.0 springboot3_com.nimbusds:nimbus-jose-jwt;9.37.3 springboot3_io.lettuce:lettuce-core;6.6.0.RELEASE -springboot3_io.micrometer:micrometer-core;1.15.3 -springboot3_io.netty:netty-buffer;4.1.124.Final -springboot3_io.netty:netty-codec-http;4.1.124.Final -springboot3_io.netty:netty-common;4.1.124.Final -springboot3_io.netty:netty-handler;4.1.124.Final -springboot3_io.netty:netty-transport-native-epoll;4.1.124.Final -springboot3_io.netty:netty-transport-native-kqueue;4.1.124.Final -springboot3_io.netty:netty-transport;4.1.124.Final -springboot3_io.projectreactor.netty:reactor-netty;1.2.9 -springboot3_io.projectreactor:reactor-test;3.7.9 +springboot3_io.micrometer:micrometer-core;1.15.7 +springboot3_io.netty:netty-buffer;4.1.130.Final +springboot3_io.netty:netty-codec-http;4.1.130.Final +springboot3_io.netty:netty-common;4.1.130.Final +springboot3_io.netty:netty-handler;4.1.130.Final +springboot3_io.netty:netty-transport-native-epoll;4.1.130.Final +springboot3_io.netty:netty-transport-native-kqueue;4.1.130.Final +springboot3_io.netty:netty-transport;4.1.130.Final +springboot3_io.projectreactor.netty:reactor-netty;1.2.13 +springboot3_io.projectreactor:reactor-test;3.7.14 springboot3_jakarta.servlet:jakarta.servlet-api;6.0.0 springboot3_jakarta.validation:jakarta.validation-api;3.0.2 springboot3_javax.annotation:javax.annotation-api;1.3.2 -springboot3_net.bytebuddy:byte-buddy-agent;1.17.7 -springboot3_net.bytebuddy:byte-buddy;1.17.7 +springboot3_net.bytebuddy:byte-buddy-agent;1.17.8 +springboot3_net.bytebuddy:byte-buddy;1.17.8 springboot3_org.apache.commons:commons-lang3;3.17.0 springboot3_org.apache.kafka:kafka-clients;3.9.1 springboot3_org.apache.maven.plugins:maven-antrun-plugin;3.1.0 -springboot3_org.apache.maven.plugins:maven-compiler-plugin;3.14.0 +springboot3_org.apache.maven.plugins:maven-compiler-plugin;3.14.1 springboot3_org.apache.maven.plugins:maven-enforcer-plugin;3.5.0 -springboot3_org.apache.maven.plugins:maven-failsafe-plugin;3.5.3 +springboot3_org.apache.maven.plugins:maven-failsafe-plugin;3.5.4 springboot3_org.apache.maven.plugins:maven-jar-plugin;3.4.2 springboot3_org.apache.maven.plugins:maven-javadoc-plugin;3.11.3 -springboot3_org.apache.maven.plugins:maven-surefire-plugin;3.5.3 -springboot3_org.assertj:assertj-core;3.27.4 +springboot3_org.apache.maven.plugins:maven-surefire-plugin;3.5.4 +springboot3_org.assertj:assertj-core;3.27.6 springboot3_org.hibernate.validator:hibernate-validator;8.0.3.Final springboot3_org.javatuples:javatuples;1.2 springboot3_org.junit.jupiter:junit-jupiter;5.12.2 -springboot3_org.messaginghub:pooled-jms;3.1.7 +springboot3_org.messaginghub:pooled-jms;3.1.8 springboot3_org.mockito:mockito-core;5.17.0 -springboot3_org.postgresql:postgresql;42.7.7 +springboot3_org.postgresql:postgresql;42.7.8 springboot3_org.revapi:revapi-maven-plugin;0.14.6 springboot3_org.slf4j:slf4j-api;2.0.17 springboot3_org.slf4j:slf4j-simple;2.0.17 -springboot3_org.springframework.boot:spring-boot-actuator-autoconfigure;3.5.5 -springboot3_org.springframework.boot:spring-boot-actuator;3.5.5 -springboot3_org.springframework.boot:spring-boot-autoconfigure;3.5.5 -springboot3_org.springframework.boot:spring-boot-configuration-metadata;3.5.5 -springboot3_org.springframework.boot:spring-boot-configuration-processor;3.5.5 -springboot3_org.springframework.boot:spring-boot-docker-compose;3.5.5 -springboot3_org.springframework.boot:spring-boot-starter-actuator;3.5.5 -springboot3_org.springframework.boot:spring-boot-starter-data-jdbc;3.5.5 -springboot3_org.springframework.boot:spring-boot-starter-integration;3.5.5 -springboot3_org.springframework.boot:spring-boot-starter-parent;3.5.5 -springboot3_org.springframework.boot:spring-boot-starter-test;3.5.5 -springboot3_org.springframework.boot:spring-boot-starter-web;3.5.5 -springboot3_org.springframework.boot:spring-boot-starter;3.5.5 -springboot3_org.springframework.boot:spring-boot-test;3.5.5 -springboot3_org.springframework.boot:spring-boot-testcontainers;3.5.5 -springboot3_org.springframework.cloud:spring-cloud-bus;4.3.0 -springboot3_org.springframework.cloud:spring-cloud-context;4.3.0 -springboot3_org.springframework.cloud:spring-cloud-starter-stream-kafka;4.3.0 -springboot3_org.springframework.cloud:spring-cloud-stream-test-binder;4.3.0 -springboot3_org.springframework.cloud:spring-cloud-stream;4.3.0 -springboot3_org.springframework.data:spring-data-commons;3.5.3 -springboot3_org.springframework.data:spring-data-redis;3.5.3 -springboot3_org.springframework.integration:spring-integration-core;6.5.1 -springboot3_org.springframework.kafka:spring-kafka;3.3.9 +springboot3_org.springframework.boot:spring-boot-actuator-autoconfigure;3.5.9 +springboot3_org.springframework.boot:spring-boot-actuator;3.5.9 +springboot3_org.springframework.boot:spring-boot-autoconfigure;3.5.9 +springboot3_org.springframework.boot:spring-boot-configuration-metadata;3.5.9 +springboot3_org.springframework.boot:spring-boot-configuration-processor;3.5.9 +springboot3_org.springframework.boot:spring-boot-docker-compose;3.5.9 +springboot3_org.springframework.boot:spring-boot-starter-actuator;3.5.9 +springboot3_org.springframework.boot:spring-boot-starter-data-jdbc;3.5.9 +springboot3_org.springframework.boot:spring-boot-starter-integration;3.5.9 +springboot3_org.springframework.boot:spring-boot-starter-parent;3.5.9 +springboot3_org.springframework.boot:spring-boot-starter-test;3.5.9 +springboot3_org.springframework.boot:spring-boot-starter-web;3.5.9 +springboot3_org.springframework.boot:spring-boot-starter;3.5.9 +springboot3_org.springframework.boot:spring-boot-test;3.5.9 +springboot3_org.springframework.boot:spring-boot-testcontainers;3.5.9 +springboot3_org.springframework.cloud:spring-cloud-bus;4.3.1 +springboot3_org.springframework.cloud:spring-cloud-context;4.3.1 +springboot3_org.springframework.cloud:spring-cloud-starter-stream-kafka;4.3.1 +springboot3_org.springframework.cloud:spring-cloud-stream-test-binder;4.3.1 +springboot3_org.springframework.cloud:spring-cloud-stream;4.3.1 +springboot3_org.springframework.data:spring-data-commons;3.5.7 +springboot3_org.springframework.data:spring-data-redis;3.5.7 +springboot3_org.springframework.integration:spring-integration-core;6.5.5 +springboot3_org.springframework.kafka:spring-kafka;3.3.11 springboot3_org.springframework.retry:spring-retry;2.0.12 -springboot3_org.springframework.security:spring-security-config;6.5.3 -springboot3_org.springframework.security:spring-security-oauth2-client;6.5.3 -springboot3_org.springframework.security:spring-security-oauth2-jose;6.5.3 -springboot3_org.springframework.security:spring-security-oauth2-resource-server;6.5.3 -springboot3_org.springframework.security:spring-security-web;6.5.3 -springboot3_org.springframework:spring-beans;6.2.10 -springboot3_org.springframework:spring-context-support;6.2.10 -springboot3_org.springframework:spring-context;6.2.10 -springboot3_org.springframework:spring-core-test;6.2.10 -springboot3_org.springframework:spring-core;6.2.10 -springboot3_org.springframework:spring-expression;6.2.10 -springboot3_org.springframework:spring-jdbc;6.2.10 -springboot3_org.springframework:spring-jms;6.2.10 -springboot3_org.springframework:spring-messaging;6.2.10 -springboot3_org.springframework:spring-test;6.2.10 -springboot3_org.springframework:spring-tx;6.2.10 -springboot3_org.springframework:spring-web;6.2.10 -springboot3_org.springframework:spring-webmvc;6.2.10 -springboot3_org.testcontainers:junit-jupiter;1.21.3 -springboot3_org.testcontainers:azure;1.21.3 +springboot3_org.springframework.security:spring-security-config;6.5.7 +springboot3_org.springframework.security:spring-security-oauth2-client;6.5.7 +springboot3_org.springframework.security:spring-security-oauth2-jose;6.5.7 +springboot3_org.springframework.security:spring-security-oauth2-resource-server;6.5.7 +springboot3_org.springframework.security:spring-security-web;6.5.7 +springboot3_org.springframework:spring-beans;6.2.15 +springboot3_org.springframework:spring-context-support;6.2.15 +springboot3_org.springframework:spring-context;6.2.15 +springboot3_org.springframework:spring-core-test;6.2.15 +springboot3_org.springframework:spring-core;6.2.15 +springboot3_org.springframework:spring-expression;6.2.15 +springboot3_org.springframework:spring-jdbc;6.2.15 +springboot3_org.springframework:spring-jms;6.2.15 +springboot3_org.springframework:spring-messaging;6.2.15 +springboot3_org.springframework:spring-test;6.2.15 +springboot3_org.springframework:spring-tx;6.2.15 +springboot3_org.springframework:spring-web;6.2.15 +springboot3_org.springframework:spring-webmvc;6.2.15 +springboot3_org.testcontainers:junit-jupiter;1.21.4 +springboot3_org.testcontainers:azure;1.21.4 springboot3_jakarta.annotation:jakarta.annotation-api;3.0.0 -springboot3_ch.qos.logback:logback-classic;1.5.18 +springboot3_ch.qos.logback:logback-classic;1.5.22 # Used for Spring version updates -springboot3_org.springframework.boot:spring-boot-dependencies;3.5.5 -springboot3_org.springframework.cloud:spring-cloud-dependencies;2025.0.0 +springboot3_org.springframework.boot:spring-boot-dependencies;3.5.9 +springboot3_org.springframework.cloud:spring-cloud-dependencies;2025.0.1 # Java 7 support diff --git a/eng/versioning/pom_file_version_scanner.ps1 b/eng/versioning/pom_file_version_scanner.ps1 index 38546e5e02c9..654188d7deb4 100644 --- a/eng/versioning/pom_file_version_scanner.ps1 +++ b/eng/versioning/pom_file_version_scanner.ps1 @@ -723,31 +723,46 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: dependency is missing version element for groupId=$($groupId), artifactId=$($artifactId) should be " continue } - if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") + + if ($versionNode.FirstChild.Value.StartsWith('${')) { - # unfortunately because there are POM exceptions we need to wildcard the group which may be - # something like _groupId - if ($versionNode.NextSibling.Value.Trim() -notmatch "{x-version-update;(.+)?$($groupId):$($artifactId);\w+}") + # skip version checks when they have been intentionally applied via variables + } + else + { + if ($versionNode.NextSibling -and $versionNode.NextSibling.NodeType -eq "Comment") { - $hasError = $true - $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: dependency version update tag for groupId=$($groupId), artifactId=$($artifactId) should be " + # unfortunately because there are POM exceptions we need to wildcard the group which may be + # something like _groupId + if ($versionNode.FirstChild.Value.StartsWith('${')) + { + # skip version checks when they have been intentionally applied via variables + } + else + { + if ($versionNode.NextSibling.Value.Trim() -notmatch "{x-version-update;(.+)?$($groupId):$($artifactId);\w+}") + { + $hasError = $true + $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: dependency version update tag for groupId=$($groupId), artifactId=$($artifactId) should be " + } + else + { + # verify the version tag and version are correct + $retVal = Test-Dependency-Tag-And-Version $libHash $extDepHash $versionNode.InnerText.Trim() $versionNode.NextSibling.Value $artifactsPerSDHashSet + if ($retVal) + { + $hasError = $true + $potentialLogMessage = Join-With-NewLine $potentialLogMessage $retVal + } + } + } } else { - # verify the version tag and version are correct - $retVal = Test-Dependency-Tag-And-Version $libHash $extDepHash $versionNode.InnerText.Trim() $versionNode.NextSibling.Value $artifactsPerSDHashSet - if ($retVal) - { - $hasError = $true - $potentialLogMessage = Join-With-NewLine $potentialLogMessage $retVal - } + $hasError = $true + $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: Missing dependency version update tag for groupId=$($groupId), artifactId=$($artifactId). The tag should be " } - } - else - { - $hasError = $true - $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: Missing dependency version update tag for groupId=$($groupId), artifactId=$($artifactId). The tag should be " - } + } } # Verify every plugin has a group, artifact and version # Verify every dependency has a group, artifact and version @@ -882,80 +897,87 @@ Get-ChildItem -Path $Path -Filter pom*.xml -Recurse -File | ForEach-Object { $groupId = $split[0] $artifactId = $split[1] $version = $split[2] - # The groupId match has to be able to deal with _ for external dependency exceptions - if (!$includeNode.NextSibling -or $includeNode.NextSibling.NodeType -ne "Comment") - { - $hasError = $true - $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: is missing the update tag which should be " - } - elseif ($includeNode.NextSibling.Value.Trim() -notmatch "{x-include-update;(.+)?$($groupId):$($artifactId);(current|dependency|external_dependency)}") - { - $hasError = $true - $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: version update tag for $($includeNode.InnerText) should be " + + if ($version.StartsWith('[${')) { + # skip version checks when they have been intentionally applied via variables } else { - # verify that the version is formatted correctly - if (!$version.StartsWith("[") -or !$version.EndsWith("]")) + # The groupId match has to be able to deal with _ for external dependency exceptions + if (!$includeNode.NextSibling -or $includeNode.NextSibling.NodeType -ne "Comment") { $hasError = $true - $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: the version entry '$($version)' for '$($rawIncludeText)' is not formatted correctly. The include version needs to of the form '[]', the braces lock the include to a specific version for these entries. -->" + $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: is missing the update tag which should be " + } + elseif ($includeNode.NextSibling.Value.Trim() -notmatch "{x-include-update;(.+)?$($groupId):$($artifactId);(current|dependency|external_dependency)}") + { + $hasError = $true + $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: version update tag for $($includeNode.InnerText) should be " } - # verify the version has the correct value else { - $versionWithoutBraces = $version.Substring(1, $version.Length -2) - # the key into the dependency has needs to be created from the tag's group/artifact - # entries in case it's an external dependency entry. Because this has already - # been validated for format, grab the group:artifact - $depKey = $includeNode.NextSibling.Value.Trim().Split(";")[1] - $depType = $includeNode.NextSibling.Value.Trim().Split(";")[2] - $depType = $depType.Substring(0, $depType.IndexOf("}")) - if ($depType -eq $DependencyTypeExternal) + # verify that the version is formatted correctly + if (!$version.StartsWith("[") -or !$version.EndsWith("]")) { - if ($extDepHash.ContainsKey($depKey)) - { - if ($versionWithoutBraces -ne $extDepHash[$depKey].ver) - { - $hasError = $true - $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: $($depKey)'s version is '$($versionWithoutBraces)' but the external_dependency version is listed as $($extDepHash[$depKey].ver)" - } - } - else - { - $hasError = $true - $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: the groupId:artifactId entry '$($depKey)' for '$($rawIncludeText)' is not a valid external dependency. Please verify the entry exists in the external_dependencies.txt file. -->" - } + $hasError = $true + $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: the version entry '$($version)' for '$($rawIncludeText)' is not formatted correctly. The include version needs to of the form '[]', the braces lock the include to a specific version for these entries. -->" } + # verify the version has the correct value else { - # If the tag isn't external_dependency then verify it exists in the library hash - if (!$libHash.ContainsKey($depKey)) - { - $hasError = $true - return "Error: $($depKey)'s dependency type is '$($depType)' but the dependency does not exist in any of the version_*.txt files. Should this be an external_dependency? Please ensure the dependency type is correct or the dependency is added to the appropriate file." - - } - if ($depType -eq $DependencyTypeDependency) + $versionWithoutBraces = $version.Substring(1, $version.Length -2) + # the key into the dependency has needs to be created from the tag's group/artifact + # entries in case it's an external dependency entry. Because this has already + # been validated for format, grab the group:artifact + $depKey = $includeNode.NextSibling.Value.Trim().Split(";")[1] + $depType = $includeNode.NextSibling.Value.Trim().Split(";")[2] + $depType = $depType.Substring(0, $depType.IndexOf("}")) + if ($depType -eq $DependencyTypeExternal) { - if ($versionWithoutBraces -ne $libHash[$depKey].depVer) + if ($extDepHash.ContainsKey($depKey)) + { + if ($versionWithoutBraces -ne $extDepHash[$depKey].ver) + { + $hasError = $true + $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: $($depKey)'s version is '$($versionWithoutBraces)' but the external_dependency version is listed as $($extDepHash[$depKey].ver)" + } + } + else { $hasError = $true - return "Error: $($depKey)'s is '$($versionString)' but the dependency version is listed as $($libHash[$depKey].depVer)" + $potentialLogMessage = Join-With-NewLine $potentialLogMessage "Error: the groupId:artifactId entry '$($depKey)' for '$($rawIncludeText)' is not a valid external dependency. Please verify the entry exists in the external_dependencies.txt file. -->" } } - elseif ($depType -eq $DependencyTypeCurrent) + else { - # Verify that none of the 'current' dependencies are using a groupId that starts with 'unreleased_' or 'beta_' - if ($depKey.StartsWith('unreleased_') -or $depKey.StartsWith('beta_')) + # If the tag isn't external_dependency then verify it exists in the library hash + if (!$libHash.ContainsKey($depKey)) { $hasError = $true - return "Error: $($versionUpdateString) is using an unreleased_ or beta_ dependency and trying to set current value. Only dependency versions can be set with an unreleased or beta dependency." + return "Error: $($depKey)'s dependency type is '$($depType)' but the dependency does not exist in any of the version_*.txt files. Should this be an external_dependency? Please ensure the dependency type is correct or the dependency is added to the appropriate file." + } - if ($versionWithoutBraces -ne $libHash[$depKey].curVer) + if ($depType -eq $DependencyTypeDependency) { - $hasError = $true - return "Error: $($depKey)'s is '$($versionString)' but the current version is listed as $($libHash[$depKey].curVer)" + if ($versionWithoutBraces -ne $libHash[$depKey].depVer) + { + $hasError = $true + return "Error: $($depKey)'s is '$($versionString)' but the dependency version is listed as $($libHash[$depKey].depVer)" + } + } + elseif ($depType -eq $DependencyTypeCurrent) + { + # Verify that none of the 'current' dependencies are using a groupId that starts with 'unreleased_' or 'beta_' + if ($depKey.StartsWith('unreleased_') -or $depKey.StartsWith('beta_')) + { + $hasError = $true + return "Error: $($versionUpdateString) is using an unreleased_ or beta_ dependency and trying to set current value. Only dependency versions can be set with an unreleased or beta dependency." + } + if ($versionWithoutBraces -ne $libHash[$depKey].curVer) + { + $hasError = $true + return "Error: $($depKey)'s is '$($versionString)' but the current version is listed as $($libHash[$depKey].curVer)" + } } } } diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt index 842251986c0d..3ad0fab9647d 100644 --- a/eng/versioning/version_client.txt +++ b/eng/versioning/version_client.txt @@ -53,6 +53,7 @@ com.azure:azure-ai-openai-realtime;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-openai-stainless;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-personalizer;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-ai-projects;1.0.0-beta.3;1.0.0-beta.4 +com.azure:azure-ai-speech-transcription;1.0.0-beta.1;1.0.0-beta.2 com.azure:azure-ai-textanalytics;5.5.11;5.6.0-beta.1 com.azure:azure-ai-textanalytics-perf;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-ai-translation-text;1.1.7;2.0.0-beta.1 @@ -114,6 +115,7 @@ com.azure:azure-cosmos-test;1.0.0-beta.16;1.0.0-beta.17 com.azure.cosmos.spark:azure-cosmos-spark_3-3_2-12;4.42.0;4.43.0-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3-4_2-12;4.42.0;4.43.0-beta.1 com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-12;4.42.0;4.43.0-beta.1 +com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-13;4.42.0;4.43.0-beta.1 com.azure.cosmos.spark:fabric-cosmos-spark-auth_3;1.1.0;1.2.0-beta.1 com.azure:azure-cosmos-tests;1.0.0-beta.1;1.0.0-beta.1 com.azure:azure-data-appconfiguration;1.8.5;1.9.0-beta.1 @@ -270,7 +272,7 @@ com.azure.spring:spring-cloud-azure-stream-binder-servicebus-core;6.1.0;6.2.0-be com.azure.spring:spring-cloud-azure-stream-binder-servicebus;6.1.0;6.2.0-beta.1 com.azure.spring:spring-cloud-azure-testcontainers;6.1.0;6.2.0-beta.1 com.azure:azure-spring-data-cosmos;6.1.0;6.2.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager;2.57.0;2.58.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager;2.58.0;2.59.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appplatform;2.51.0;2.52.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-appservice;2.54.1;2.55.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-authorization;2.53.6;2.54.0-beta.1 @@ -306,9 +308,9 @@ com.azure.resourcemanager:azure-resourcemanager-relay;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-costmanagement;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-recoveryservices;1.5.0;1.6.0 com.azure.resourcemanager:azure-resourcemanager-kusto;1.2.0;1.3.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-loganalytics;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-loganalytics;2.1.0;2.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-eventgrid;1.2.0;1.3.0-beta.2 -com.azure.resourcemanager:azure-resourcemanager-healthbot;1.1.0;1.2.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-healthbot;1.1.0;1.2.0 com.azure.resourcemanager:azure-resourcemanager-confluent;1.2.0;1.3.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.3.0;1.4.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-netapp;2.0.0;2.1.0-beta.2 @@ -358,7 +360,7 @@ com.azure.resourcemanager:azure-resourcemanager-servicefabric;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-peering;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-policyinsights;1.0.0;1.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-support;1.1.0;1.2.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-subscription;1.0.0;1.1.0-beta.1 +com.azure.resourcemanager:azure-resourcemanager-subscription;1.0.0;1.1.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-powerbidedicated;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-applicationinsights;1.1.0;1.2.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-deploymentmanager;1.0.0-beta.2;1.0.0-beta.3 @@ -432,7 +434,7 @@ com.azure.resourcemanager:azure-resourcemanager-recoveryservicessiterecovery;1.3 com.azure.resourcemanager:azure-resourcemanager-billingbenefits;1.0.0-beta.2;1.0.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-providerhub;2.0.0;2.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-reservations;1.0.0;1.1.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.2.0;1.3.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-containerservicefleet;1.2.0;1.3.0-beta.3 com.azure.resourcemanager:azure-resourcemanager-storagemover;1.4.0;1.5.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-graphservices;1.1.0;1.2.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-voiceservices;1.1.0;1.2.0-beta.1 @@ -493,7 +495,7 @@ com.azure.resourcemanager:azure-resourcemanager-lambdatesthyperexecute;1.0.0;1.1 com.azure.resourcemanager:azure-resourcemanager-onlineexperimentation;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-secretsstoreextension;1.0.0-beta.1;1.0.0-beta.2 com.azure.resourcemanager:azure-resourcemanager-programmableconnectivity;1.0.0-beta.1;1.0.0-beta.1 -com.azure.resourcemanager:azure-resourcemanager-dell-storage;1.0.0-beta.1;1.0.0-beta.2 +com.azure.resourcemanager:azure-resourcemanager-dell-storage;1.0.0-beta.1;1.0.0 com.azure.resourcemanager:azure-resourcemanager-sitemanager;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-mongodbatlas;1.0.0;1.1.0-beta.1 com.azure.resourcemanager:azure-resourcemanager-purestorageblock;1.0.0;1.1.0-beta.1 diff --git a/pom.xml b/pom.xml index 8c702d55c621..020e7eae65cd 100644 --- a/pom.xml +++ b/pom.xml @@ -265,6 +265,7 @@ sdk/timeseriesinsights sdk/tools sdk/trafficmanager + sdk/transcription sdk/translation sdk/trustedsigning sdk/vision diff --git a/sdk/ai/azure-ai-agents/CHANGELOG.md b/sdk/ai/azure-ai-agents/CHANGELOG.md index a3ca8244915d..2de616879d89 100644 --- a/sdk/ai/azure-ai-agents/CHANGELOG.md +++ b/sdk/ai/azure-ai-agents/CHANGELOG.md @@ -7,6 +7,7 @@ - New `MemorySearchAgent` sample was added demonstrating memory search functionality - Tests for `MemoryStoresClient` and `MemoryStoresAsyncClient` - Various documentation updates +- Using unified `HttpClient` setup for Azure specifics and `openai` client library wrapping methods ### Breaking Changes @@ -16,6 +17,8 @@ ### Other Changes +- Updated version of `openai` client library to `4.14.0` + ## 1.0.0-beta.1 (2025-11-12) ### Features Added diff --git a/sdk/ai/azure-ai-agents/pom.xml b/sdk/ai/azure-ai-agents/pom.xml index 378c86a00a9b..b50a8af301e6 100644 --- a/sdk/ai/azure-ai-agents/pom.xml +++ b/sdk/ai/azure-ai-agents/pom.xml @@ -52,7 +52,7 @@ com.openai openai-java - 4.6.1 + 4.14.0 com.azure @@ -97,7 +97,7 @@ - com.openai:openai-java:[4.6.1] + com.openai:openai-java:[4.14.0] diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/http/HttpClientHelper.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/http/HttpClientHelper.java index e7df9ee0c91f..8052a17e5902 100644 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/http/HttpClientHelper.java +++ b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/http/HttpClientHelper.java @@ -28,8 +28,11 @@ import com.openai.errors.UnauthorizedException; import com.openai.errors.UnexpectedStatusCodeException; import com.openai.errors.UnprocessableEntityException; +import reactor.core.publisher.Mono; import java.io.ByteArrayOutputStream; +import java.net.MalformedURLException; +import java.net.URI; import java.util.List; import java.util.Objects; import java.util.concurrent.CompletableFuture; @@ -82,10 +85,14 @@ public HttpResponse execute(HttpRequest request, RequestOptions requestOptions) Objects.requireNonNull(request, "request"); Objects.requireNonNull(requestOptions, "requestOptions"); - com.azure.core.http.HttpRequest azureRequest = buildAzureRequest(request); - - return new AzureHttpResponseAdapter( - this.httpPipeline.sendSync(azureRequest, buildRequestContext(requestOptions))); + try { + com.azure.core.http.HttpRequest azureRequest = buildAzureRequest(request); + return new AzureHttpResponseAdapter( + this.httpPipeline.sendSync(azureRequest, buildRequestContext(requestOptions))); + } catch (MalformedURLException exception) { + throw new OpenAIException("Invalid URL in request: " + exception.getMessage(), + LOGGER.logThrowableAsError(exception)); + } } @Override @@ -98,9 +105,8 @@ public CompletableFuture executeAsync(HttpRequest request, Request Objects.requireNonNull(request, "request"); Objects.requireNonNull(requestOptions, "requestOptions"); - final com.azure.core.http.HttpRequest azureRequest = buildAzureRequest(request); - - return this.httpPipeline.send(azureRequest, buildRequestContext(requestOptions)) + return Mono.fromCallable(() -> buildAzureRequest(request)) + .flatMap(azureRequest -> this.httpPipeline.send(azureRequest, buildRequestContext(requestOptions))) .map(response -> (HttpResponse) new AzureHttpResponseAdapter(response)) .onErrorMap(HttpClientWrapper::mapAzureExceptionToOpenAI) .toFuture(); @@ -163,7 +169,7 @@ private static Throwable mapAzureExceptionToOpenAI(Throwable throwable) { } else if (throwable instanceof TimeoutException) { return throwable; } else { - return new OpenAIException(throwable.getMessage(), throwable.getCause()); + return new OpenAIException(throwable.getMessage(), throwable); } } @@ -179,7 +185,8 @@ private static Headers toOpenAIHeaders(HttpHeaders azureHeaders) { /** * Converts the OpenAI request metadata and body into an Azure {@link com.azure.core.http.HttpRequest}. */ - private static com.azure.core.http.HttpRequest buildAzureRequest(HttpRequest request) { + private static com.azure.core.http.HttpRequest buildAzureRequest(HttpRequest request) + throws MalformedURLException { HttpRequestBody requestBody = request.body(); String contentType = requestBody != null ? requestBody.contentType() : null; BinaryData bodyData = null; @@ -196,7 +203,7 @@ private static com.azure.core.http.HttpRequest buildAzureRequest(HttpRequest req } com.azure.core.http.HttpRequest azureRequest = new com.azure.core.http.HttpRequest( - HttpMethod.valueOf(request.method().name()), OpenAiRequestUrlBuilder.buildUrl(request), headers); + HttpMethod.valueOf(request.method().name()), URI.create(request.url()).toURL(), headers); if (bodyData != null) { azureRequest.setBody(bodyData); diff --git a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/http/OpenAiRequestUrlBuilder.java b/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/http/OpenAiRequestUrlBuilder.java deleted file mode 100644 index f4490f771020..000000000000 --- a/sdk/ai/azure-ai-agents/src/main/java/com/azure/ai/agents/implementation/http/OpenAiRequestUrlBuilder.java +++ /dev/null @@ -1,138 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.ai.agents.implementation.http; - -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.openai.core.http.HttpRequest; -import com.openai.core.http.QueryParams; - -import java.net.MalformedURLException; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.List; -import java.util.StringJoiner; - -/** - * Utility methods that reconstruct the absolute {@link URL} required by the Azure pipeline from the - * OpenAI request metadata. The builder keeps the low-level path/query handling isolated so that - * {@link HttpClientHelper} can focus on the higher-level request mapping logic. - * This class will be deprecated as soon as support is added in the OpenAI SDK as described in this issue: - * - */ -public final class OpenAiRequestUrlBuilder { - - private static final ClientLogger LOGGER = new ClientLogger(OpenAiRequestUrlBuilder.class); - - private OpenAiRequestUrlBuilder() { - } - - /** - * Builds an absolute {@link URL} using the base URL, path segments, and query parameters that are stored in the - * OpenAI {@link HttpRequest} abstraction. - * This method will be deprecated as soon as support is added in the OpenAI SDK as described in this issue: - * - * - * @param request Source request provided by the OpenAI client. - * @return Absolute URL that can be consumed by Azure HTTP components. - */ - static URL buildUrl(HttpRequest request) { - try { - URI baseUri = URI.create(request.baseUrl()); - URL baseUrl = baseUri.toURL(); - String path = buildPath(baseUrl.getPath(), request.pathSegments()); - String query = buildQueryString(request.queryParams()); - URI resolved = new URI(baseUrl.getProtocol(), baseUrl.getUserInfo(), baseUrl.getHost(), baseUrl.getPort(), - path, query, null); - return resolved.toURL(); - } catch (MalformedURLException | URISyntaxException ex) { - throw LOGGER.logThrowableAsWarning(new IllegalStateException( - "Failed to build Azure HTTP request URL from base: " + request.baseUrl(), ex)); - } - } - - /** - * Creates a normalized path that merges the OpenAI base path with the additional path segments present on the - * request. - */ - private static String buildPath(String basePath, List pathSegments) { - StringBuilder builder = new StringBuilder(); - String normalizedBasePath = normalizeBasePath(basePath); - if (!CoreUtils.isNullOrEmpty(normalizedBasePath)) { - builder.append(normalizedBasePath); - } - - for (String segment : pathSegments) { - if (builder.length() == 0 || builder.charAt(builder.length() - 1) != '/') { - builder.append('/'); - } - if (segment != null) { - builder.append(segment); - } - } - - return builder.length() == 0 ? "/" : builder.toString(); - } - - /** - * Normalizes the base path ensuring trailing slashes are removed and {@code null} inputs result in an empty path. - */ - private static String normalizeBasePath(String basePath) { - if (CoreUtils.isNullOrEmpty(basePath)) { - return ""; - } - if ("/".equals(basePath)) { - return ""; - } - return trimTrailingSlash(basePath); - } - - /** - * Removes the final {@code '/'} character when present so that subsequent concatenation does not duplicate - * separators. - */ - private static String trimTrailingSlash(String value) { - if (value == null) { - return null; - } - int length = value.length(); - if (length == 0) { - return value; - } - return value.charAt(length - 1) == '/' ? value.substring(0, length - 1) : value; - } - - /** - * Converts OpenAI {@link QueryParams} into a flattened query string. Encoding is deferred to {@link URI} so we do - * not double-encode values already escaped by upstream layers. - */ - private static String buildQueryString(QueryParams queryParams) { - if (queryParams == null || queryParams.isEmpty()) { - return null; - } - - StringJoiner joiner = new StringJoiner("&"); - queryParams.keys().forEach(name -> { - List values = queryParams.values(name); - if (values.isEmpty()) { - joiner.add(name); - } else { - values.forEach(value -> joiner.add(formatQueryComponent(name, value))); - } - }); - String query = joiner.toString(); - return query.isEmpty() ? null : query; - } - - /** - * Formats a single query component using {@code name=value} semantics, handling parameters that omit a value. - */ - private static String formatQueryComponent(String name, String value) { - if (value == null) { - return name; - } - return name + "=" + value; - } -} diff --git a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/implementation/http/HttpClientHelperTests.java b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/implementation/http/HttpClientHelperTests.java index 59ab92fb7cde..bf3b9a4bd77b 100644 --- a/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/implementation/http/HttpClientHelperTests.java +++ b/sdk/ai/azure-ai-agents/src/test/java/com/azure/ai/agents/implementation/http/HttpClientHelperTests.java @@ -4,9 +4,7 @@ package com.azure.ai.agents.implementation.http; import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpMethod; import com.azure.core.http.HttpPipelineBuilder; import com.azure.core.http.HttpRequest; import com.azure.core.http.HttpResponse; @@ -27,7 +25,6 @@ import java.util.concurrent.CompletableFuture; import java.util.function.Function; -import static org.junit.jupiter.api.Assertions.assertArrayEquals; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -36,39 +33,6 @@ class HttpClientHelperTests { - private static final HttpHeaderName REQUEST_ID_HEADER = HttpHeaderName.fromString("x-request-id"); - private static final HttpHeaderName CUSTOM_HEADER_NAME = HttpHeaderName.fromString("custom-header"); - private static final HttpHeaderName X_TEST_HEADER = HttpHeaderName.fromString("X-Test"); - private static final HttpHeaderName X_MULTI_HEADER = HttpHeaderName.fromString("X-Multi"); - - @Test - void executeMapsRequestAndResponse() { - RecordingHttpClient recordingClient = new RecordingHttpClient(request -> createMockResponse(request, 201, - new HttpHeaders().set(REQUEST_ID_HEADER, "req-123").set(CUSTOM_HEADER_NAME, "custom-value"), "pong")); - com.openai.core.http.HttpClient openAiClient - = HttpClientHelper.mapToOpenAIHttpClient(new HttpPipelineBuilder().httpClient(recordingClient).build()); - - com.openai.core.http.HttpRequest openAiRequest = createOpenAiRequest(); - - try (com.openai.core.http.HttpResponse response = openAiClient.execute(openAiRequest)) { - HttpRequest sentRequest = recordingClient.getLastRequest(); - assertNotNull(sentRequest, "Azure HttpClient should receive a request"); - assertEquals(HttpMethod.POST, sentRequest.getHttpMethod()); - assertEquals("https://example.com/path/segment?q=a%20b", sentRequest.getUrl().toString()); - assertEquals("alpha", sentRequest.getHeaders().getValue(X_TEST_HEADER)); - assertArrayEquals(new String[] { "first", "second" }, sentRequest.getHeaders().getValues(X_MULTI_HEADER)); - assertEquals("text/plain", sentRequest.getHeaders().getValue(HttpHeaderName.CONTENT_TYPE)); - assertEquals("payload", new String(sentRequest.getBodyAsBinaryData().toBytes(), StandardCharsets.UTF_8)); - - assertEquals(201, response.statusCode()); - assertEquals("req-123", response.requestId().orElseThrow(() -> new AssertionError("Missing request id"))); - assertEquals("custom-value", response.headers().values("custom-header").get(0)); - assertEquals("pong", new String(readAllBytes(response.body()), StandardCharsets.UTF_8)); - } catch (Exception e) { - fail("Exception thrown while reading response", e); - } - } - @Test void executeAsyncCompletesSuccessfully() { RecordingHttpClient recordingClient diff --git a/sdk/ai/azure-ai-projects/CHANGELOG.md b/sdk/ai/azure-ai-projects/CHANGELOG.md index 52515ee47e88..24f3793a26a4 100644 --- a/sdk/ai/azure-ai-projects/CHANGELOG.md +++ b/sdk/ai/azure-ai-projects/CHANGELOG.md @@ -10,6 +10,8 @@ ### Other Changes +- Updated version of `openai` client library to `4.14.0` + ## 1.0.0-beta.3 (2025-11-12) ### Features Added diff --git a/sdk/ai/azure-ai-projects/pom.xml b/sdk/ai/azure-ai-projects/pom.xml index b58668f4d6b9..c7647d97cdb1 100644 --- a/sdk/ai/azure-ai-projects/pom.xml +++ b/sdk/ai/azure-ai-projects/pom.xml @@ -77,7 +77,7 @@ Code generated by Microsoft (R) TypeSpec Code Generator. com.openai openai-java - 4.6.1 + 4.14.0 @@ -106,7 +106,7 @@ Code generated by Microsoft (R) TypeSpec Code Generator. - com.openai:openai-java:[4.6.1] + com.openai:openai-java:[4.14.0] diff --git a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml index 747f78fa0fa5..20679e04f43a 100644 --- a/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml +++ b/sdk/applicationinsights/azure-resourcemanager-applicationinsights/pom.xml @@ -98,7 +98,7 @@ com.azure.resourcemanager azure-resourcemanager-loganalytics - 1.1.0 + 2.1.0 test diff --git a/sdk/batch/azure-compute-batch/pom.xml b/sdk/batch/azure-compute-batch/pom.xml index 12d70cd6181a..045c932c4615 100644 --- a/sdk/batch/azure-compute-batch/pom.xml +++ b/sdk/batch/azure-compute-batch/pom.xml @@ -85,7 +85,7 @@ com.azure.resourcemanager azure-resourcemanager - 2.57.0 + 2.58.0 test diff --git a/sdk/boms/spring-cloud-azure-dependencies/pom.xml b/sdk/boms/spring-cloud-azure-dependencies/pom.xml index 0c9af5132d49..cd69d2263ed4 100644 --- a/sdk/boms/spring-cloud-azure-dependencies/pom.xml +++ b/sdk/boms/spring-cloud-azure-dependencies/pom.xml @@ -60,7 +60,7 @@ com.azure.resourcemanager azure-resourcemanager - 2.57.0 + 2.58.0 diff --git a/sdk/clientcore/http-netty4/pom.xml b/sdk/clientcore/http-netty4/pom.xml index 4a4a7905215c..7590e0004aa0 100644 --- a/sdk/clientcore/http-netty4/pom.xml +++ b/sdk/clientcore/http-netty4/pom.xml @@ -56,7 +56,7 @@ io.clientcore.core.implementation*,io.clientcore.core.models,io.clientcore.core.util,io.clientcore.core.util* - 4.1.127.Final + 4.1.130.Final @@ -69,52 +69,52 @@ io.netty netty-buffer - 4.1.127.Final + 4.1.130.Final io.netty netty-codec - 4.1.127.Final + 4.1.130.Final io.netty netty-codec-http - 4.1.127.Final + 4.1.130.Final io.netty netty-codec-http2 - 4.1.127.Final + 4.1.130.Final io.netty netty-common - 4.1.127.Final + 4.1.130.Final io.netty netty-handler - 4.1.127.Final + 4.1.130.Final io.netty netty-handler-proxy - 4.1.127.Final + 4.1.130.Final io.netty netty-resolver - 4.1.127.Final + 4.1.130.Final io.netty netty-resolver-dns - 4.1.127.Final + 4.1.130.Final io.netty netty-transport - 4.1.127.Final + 4.1.130.Final @@ -129,14 +129,14 @@ io.netty netty-transport-native-unix-common - 4.1.127.Final + 4.1.130.Final linux-x86_64 test io.netty netty-transport-native-epoll - 4.1.127.Final + 4.1.130.Final linux-x86_64 test @@ -144,14 +144,14 @@ io.netty netty-transport-native-unix-common - 4.1.127.Final + 4.1.130.Final osx-x86_64 test io.netty netty-transport-native-kqueue - 4.1.127.Final + 4.1.130.Final osx-x86_64 test @@ -223,16 +223,16 @@ - io.netty:netty-buffer:[4.1.127.Final] - io.netty:netty-codec:[4.1.127.Final] - io.netty:netty-codec-http:[4.1.127.Final] - io.netty:netty-codec-http2:[4.1.127.Final] - io.netty:netty-common:[4.1.127.Final] - io.netty:netty-handler:[4.1.127.Final] - io.netty:netty-handler-proxy:[4.1.127.Final] - io.netty:netty-resolver:[4.1.127.Final] - io.netty:netty-resolver-dns:[4.1.127.Final] - io.netty:netty-transport:[4.1.127.Final] + io.netty:netty-buffer:[4.1.130.Final] + io.netty:netty-codec:[4.1.130.Final] + io.netty:netty-codec-http:[4.1.130.Final] + io.netty:netty-codec-http2:[4.1.130.Final] + io.netty:netty-common:[4.1.130.Final] + io.netty:netty-handler:[4.1.130.Final] + io.netty:netty-handler-proxy:[4.1.130.Final] + io.netty:netty-resolver:[4.1.130.Final] + io.netty:netty-resolver-dns:[4.1.130.Final] + io.netty:netty-transport:[4.1.130.Final] diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance/assets.json b/sdk/containerinstance/azure-resourcemanager-containerinstance/assets.json index b1a68ecfaf1a..5ae2803d305d 100644 --- a/sdk/containerinstance/azure-resourcemanager-containerinstance/assets.json +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/containerinstance/azure-resourcemanager-containerinstance", - "Tag": "java/containerinstance/azure-resourcemanager-containerinstance_a0e5cc2e29" + "Tag": "java/containerinstance/azure-resourcemanager-containerinstance_cade898991" } diff --git a/sdk/containerinstance/azure-resourcemanager-containerinstance/src/test/java/com/azure/resourcemanager/containerinstance/ContainerGroupTest.java b/sdk/containerinstance/azure-resourcemanager-containerinstance/src/test/java/com/azure/resourcemanager/containerinstance/ContainerGroupTest.java index 2ed7cce6084e..6a597a99d78b 100644 --- a/sdk/containerinstance/azure-resourcemanager-containerinstance/src/test/java/com/azure/resourcemanager/containerinstance/ContainerGroupTest.java +++ b/sdk/containerinstance/azure-resourcemanager-containerinstance/src/test/java/com/azure/resourcemanager/containerinstance/ContainerGroupTest.java @@ -3,12 +3,12 @@ package com.azure.resourcemanager.containerinstance; +import com.azure.core.management.Region; import com.azure.core.test.annotation.DoNotRecord; import com.azure.resourcemanager.containerinstance.models.Container; import com.azure.resourcemanager.containerinstance.models.ContainerAttachResult; import com.azure.resourcemanager.containerinstance.models.ContainerExec; import com.azure.resourcemanager.containerinstance.models.ContainerGroup; -import com.azure.core.management.Region; import com.azure.resourcemanager.containerinstance.models.ContainerGroupRestartPolicy; import com.azure.resourcemanager.containerinstance.models.ContainerHttpGet; import com.azure.resourcemanager.containerinstance.models.ContainerProbe; @@ -19,6 +19,7 @@ import com.azure.resourcemanager.resources.fluentcore.model.Accepted; import com.azure.resourcemanager.resources.fluentcore.utils.ResourceManagerUtils; import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import java.time.Duration; @@ -210,8 +211,11 @@ public void testBeginCreate() { } // test contains a data-plane call + // Azure Storage doesn't support SMB mounting of file share using managed identity + // https://learn.microsoft.com/azure/container-instances/container-instances-volume-azure-files @DoNotRecord(skipInPlayback = true) @Test + @Disabled("This request was denied due to internal policy. Container Group requires that Storage Accounts is authenticated with managed identity, but Azure Storage doesn't support SMB mounting of file share using managed identity. ") public void testBeginCreateWithFileShareVolume() { String containerGroupName = generateRandomResourceName("container", 20); Region region = Region.US_WEST3; @@ -232,6 +236,27 @@ public void testBeginCreateWithFileShareVolume() { Assertions.assertEquals(1, containerGroup.volumes().size()); } + @DoNotRecord(skipInPlayback = true) + @Test + public void testBeginCreateWithEmptyDirectoryVolume() { + String containerGroupName = generateRandomResourceName("container", 20); + Region region = Region.US_WEST3; + + // create virtual network before creating container group + Accepted acceptedContainerGroup = containerInstanceManager.containerGroups() + .define(containerGroupName) + .withRegion(region) + .withNewResourceGroup(rgName) + .withLinux() + .withPublicImageRegistryOnly() + .withEmptyDirectoryVolume("vol2") + .withContainerInstance("nginx", 80) + .withNewVirtualNetwork("10.0.0.0/24") + .beginCreate(); + ContainerGroup containerGroup = acceptedContainerGroup.getSyncPoller().getFinalResult(); + Assertions.assertEquals(1, containerGroup.volumes().size()); + } + @Test public void testCreateWithAutoGeneratedDomainNameLabelScope() { String containerGroupName = generateRandomResourceName("container", 20); diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/CHANGELOG.md b/sdk/containerregistry/azure-resourcemanager-containerregistry/CHANGELOG.md index 517e6d80f52c..99040f2dc72c 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/CHANGELOG.md +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/CHANGELOG.md @@ -2,13 +2,16 @@ ## 2.55.0-beta.2 (Unreleased) -### Features Added - ### Breaking Changes -### Bugs Fixed +#### Changes to `ContainerRegistryManagementClient` Class -### Other Changes +- Moved `ContainerRegistryManager.serviceClient().getAgentPools()` to `ContainerRegistryManager.taskClient().getAgentPools()`. +- Moved `ContainerRegistryManager.serviceClient().getRuns()` to `ContainerRegistryManager.taskClient().getRuns()`. +- Moved `ContainerRegistryManager.serviceClient().getTaskRuns()` to `ContainerRegistryManager.taskClient().getTaskRuns()`. +- Moved `ContainerRegistryManager.serviceClient().getTasks()` to `ContainerRegistryManager.taskClient().getTasks()`. +- Moved `ContainerRegistryManager.serviceClient().getRegistries().scheduleRun(...)` to `ContainerRegistryManager.taskClient().getRegistryTasks().scheduleRun(...)`. +- Moved `ContainerRegistryManager.serviceClient().getRegistries().getBuildSourceUploadUrl(...)` to `ContainerRegistryManager.taskClient().getRegistryTasks().getBuildSourceUploadUrl(...)`. ## 2.55.0-beta.1 (2025-12-04) diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java index 6dc65d0cd3d9..642f98bbe52b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/ContainerRegistryManager.java @@ -6,7 +6,9 @@ import com.azure.core.credential.TokenCredential; import com.azure.core.http.HttpPipeline; import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryManagementClient; +import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryTasksManagementClient; import com.azure.resourcemanager.containerregistry.implementation.ContainerRegistryManagementClientBuilder; +import com.azure.resourcemanager.containerregistry.implementation.ContainerRegistryTasksManagementClientBuilder; import com.azure.resourcemanager.containerregistry.implementation.RegistriesImpl; import com.azure.resourcemanager.containerregistry.implementation.RegistryTaskRunsImpl; import com.azure.resourcemanager.containerregistry.implementation.RegistryTasksImpl; @@ -28,6 +30,8 @@ public final class ContainerRegistryManager extends Manager regenerateCredentialWithResponse(St @ServiceMethod(returns = ReturnType.SINGLE) RegistryListCredentialsResultInner regenerateCredential(String resourceGroupName, String registryName, RegenerateCredentialParameters regenerateCredentialParameters); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, - RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, String registryName, - RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest, Context context); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest); - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @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 upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, - String registryName); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @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 upload location for the user to be able to upload the source on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @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 upload location for the user to be able to upload the source along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, - String registryName, Context context); - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @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 upload location for the user to be able to upload the source. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java new file mode 100644 index 000000000000..24b172ae4ea6 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RegistryTasksClient.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.containerregistry.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +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.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; +import com.azure.resourcemanager.containerregistry.models.RunRequest; +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 RegistryTasksClient. + */ +public interface RegistryTasksClient { + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, + RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 PollerFlux} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, String registryName, + RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, + RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, + RunRequest runRequest, Context context); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest); + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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 upload location for the user to be able to upload the source along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, + String registryName); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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 upload location for the user to be able to upload the source on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getBuildSourceUploadUrlAsync(String resourceGroupName, String registryName); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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 upload location for the user to be able to upload the source along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, + String registryName, Context context); + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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 upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName); +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java index 229f30005c99..d6c282196a48 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/RunsClient.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TaskRunsClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TaskRunsClient.java index 44919b70d17e..8ab63b2f8e28 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TaskRunsClient.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TaskRunsClient.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java index 93e132854de2..65cf89781850 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/TasksClient.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolInner.java index 49322ead9632..e575d38d296e 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolInner.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolProperties.java index a8796ceb0dce..7376202c1ffe 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolProperties.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolPropertiesUpdateParameters.java index 56c452919609..0d731bdc76c5 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolPropertiesUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolPropertiesUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolQueueStatusInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolQueueStatusInner.java index ce56385fdb1a..e626204e745b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolQueueStatusInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/AgentPoolQueueStatusInner.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunGetLogResultInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunGetLogResultInner.java index 4139898a883a..9d262a72261f 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunGetLogResultInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunGetLogResultInner.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java index 1d7449348ee0..a98935a66352 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunInner.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunProperties.java index afb15caa1a57..bcc8c5687eb5 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/RunProperties.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/SourceUploadDefinitionInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/SourceUploadDefinitionInner.java index 4bd6a1c5e738..2a76cb1c3983 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/SourceUploadDefinitionInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/SourceUploadDefinitionInner.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java index 70311f245a8d..e0f7cb0bad67 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskInner.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskProperties.java index 2f691252ba66..c04bbc274a5b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskProperties.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskPropertiesUpdateParameters.java index 818113676c2f..07550d431eee 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskPropertiesUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskPropertiesUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunInner.java index 4d9203fa1fb9..c61d51902590 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunInner.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunPropertiesInner.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunPropertiesInner.java index 63dc11e58390..5259d3728bfd 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunPropertiesInner.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunPropertiesInner.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunPropertiesUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunPropertiesUpdateParameters.java index fbb11f0330a5..63f7171e81d5 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunPropertiesUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/fluent/models/TaskRunPropertiesUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.fluent.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java index a805c61d0ae6..d99667a60b4e 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/AgentPoolsClientImpl.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.implementation; @@ -54,25 +53,25 @@ public final class AgentPoolsClientImpl implements AgentPoolsClient { /** * The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; + private final ContainerRegistryTasksManagementClientImpl client; /** * Initializes an instance of AgentPoolsClientImpl. * * @param client the instance of the service client containing this operation class. */ - AgentPoolsClientImpl(ContainerRegistryManagementClientImpl client) { + AgentPoolsClientImpl(ContainerRegistryTasksManagementClientImpl client) { this.service = RestProxy.create(AgentPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ContainerRegistryManagementClientAgentPools to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for ContainerRegistryTasksManagementClientAgentPools to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryManagementClientAgentPools") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientAgentPools") public interface AgentPoolsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}") @@ -176,11 +175,10 @@ public Mono> getWithResponseAsync(String resourceGroupN if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), agentPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -218,11 +216,10 @@ private Mono> getWithResponseAsync(String resourceGroup if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, agentPoolName, accept, context); + this.client.getApiVersion(), agentPoolName, accept, context); } /** @@ -315,11 +312,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { agentPool.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, agentPool, accept, context)) + .withContext( + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), agentPoolName, agentPool, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -363,11 +360,10 @@ private Mono>> createWithResponseAsync(String resource } else { agentPool.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, agentPoolName, agentPool, accept, context); + registryName, this.client.getApiVersion(), agentPoolName, agentPool, accept, context); } /** @@ -560,11 +556,10 @@ public Mono>> deleteWithResponseAsync(String resourceG if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), agentPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -601,11 +596,10 @@ private Mono>> deleteWithResponseAsync(String resource if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, agentPoolName, accept, context); + registryName, this.client.getApiVersion(), agentPoolName, accept, context); } /** @@ -791,11 +785,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { updateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, updateParameters, accept, context)) + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), agentPoolName, updateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -840,11 +834,10 @@ private Mono>> updateWithResponseAsync(String resource } else { updateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, agentPoolName, updateParameters, accept, context); + registryName, this.client.getApiVersion(), agentPoolName, updateParameters, accept, context); } /** @@ -1032,11 +1025,10 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), 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())); @@ -1071,12 +1063,11 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, accept, context) + this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1178,11 +1169,10 @@ public Mono> getQueueStatusWithResponseAsync if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getQueueStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, agentPoolName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), agentPoolName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1220,11 +1210,10 @@ private Mono> getQueueStatusWithResponseAsyn if (agentPoolName == null) { return Mono.error(new IllegalArgumentException("Parameter agentPoolName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getQueueStatus(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, agentPoolName, accept, context); + registryName, this.client.getApiVersion(), agentPoolName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CacheRulesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CacheRulesClientImpl.java index 80259eabafc2..d13e96681ec0 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CacheRulesClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CacheRulesClientImpl.java @@ -157,11 +157,10 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -197,12 +196,11 @@ private Mono> listSinglePageAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -308,11 +306,10 @@ public Mono> getWithResponseAsync(String resourceGroupN if (cacheRuleName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, cacheRuleName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, cacheRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -350,11 +347,10 @@ private Mono> getWithResponseAsync(String resourceGroup if (cacheRuleName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, cacheRuleName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, cacheRuleName, accept, context); } /** @@ -448,12 +444,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { cacheRuleCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, cacheRuleName, + cacheRuleCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -498,11 +493,10 @@ private Mono>> createWithResponseAsync(String resource } else { cacheRuleCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, cacheRuleName, cacheRuleCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, cacheRuleName, cacheRuleCreateParameters, accept, context); } /** @@ -705,12 +699,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { cacheRuleUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, cacheRuleName, + cacheRuleUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -755,11 +748,10 @@ private Mono>> updateWithResponseAsync(String resource } else { cacheRuleUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, cacheRuleName, cacheRuleUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, cacheRuleName, cacheRuleUpdateParameters, accept, context); } /** @@ -956,10 +948,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (cacheRuleName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, cacheRuleName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -997,11 +988,10 @@ private Mono>> deleteWithResponseAsync(String resource if (cacheRuleName == null) { return Mono.error(new IllegalArgumentException("Parameter cacheRuleName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, cacheRuleName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, cacheRuleName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ConnectedRegistriesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ConnectedRegistriesClientImpl.java index babaa45ad9aa..b6ad0c58b8fa 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ConnectedRegistriesClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ConnectedRegistriesClientImpl.java @@ -175,11 +175,10 @@ private Mono> listSinglePageAsync(String r if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, filter, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -218,12 +217,11 @@ private Mono> listSinglePageAsync(String r if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, filter, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -360,11 +358,9 @@ public Mono> getWithResponseAsync(String resour return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, connectedRegistryName, accept, context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -403,11 +399,10 @@ private Mono> getWithResponseAsync(String resou return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, connectedRegistryName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, connectedRegistryName, accept, context); } /** @@ -503,10 +498,9 @@ public Mono>> createWithResponseAsync(String resourceG } else { connectedRegistryCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -554,11 +548,10 @@ private Mono>> createWithResponseAsync(String resource } else { connectedRegistryCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, connectedRegistryName, connectedRegistryCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, connectedRegistryName, connectedRegistryCreateParameters, accept, context); } /** @@ -776,10 +769,9 @@ public Mono>> updateWithResponseAsync(String resourceG } else { connectedRegistryUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -828,11 +820,10 @@ private Mono>> updateWithResponseAsync(String resource } else { connectedRegistryUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, connectedRegistryName, connectedRegistryUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, connectedRegistryName, connectedRegistryUpdateParameters, accept, context); } /** @@ -1044,12 +1035,9 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, connectedRegistryName, accept, context)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1087,11 +1075,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, connectedRegistryName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, connectedRegistryName, accept, context); } /** @@ -1271,12 +1258,11 @@ public Mono>> deactivateWithResponseAsync(String resou return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.deactivate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, connectedRegistryName, accept, context)) + .withContext(context -> service.deactivate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1314,11 +1300,10 @@ private Mono>> deactivateWithResponseAsync(String reso return Mono .error(new IllegalArgumentException("Parameter connectedRegistryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deactivate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, connectedRegistryName, accept, context); + return service.deactivate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, connectedRegistryName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java index 939a27a25c68..1f67f083ab3b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryManagementClientImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.HttpPipeline; import com.azure.core.management.AzureEnvironment; import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.resourcemanager.containerregistry.fluent.AgentPoolsClient; import com.azure.resourcemanager.containerregistry.fluent.CacheRulesClient; import com.azure.resourcemanager.containerregistry.fluent.ConnectedRegistriesClient; import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryManagementClient; @@ -17,10 +16,7 @@ import com.azure.resourcemanager.containerregistry.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.containerregistry.fluent.RegistriesClient; import com.azure.resourcemanager.containerregistry.fluent.ReplicationsClient; -import com.azure.resourcemanager.containerregistry.fluent.RunsClient; import com.azure.resourcemanager.containerregistry.fluent.ScopeMapsClient; -import com.azure.resourcemanager.containerregistry.fluent.TaskRunsClient; -import com.azure.resourcemanager.containerregistry.fluent.TasksClient; import com.azure.resourcemanager.containerregistry.fluent.TokensClient; import com.azure.resourcemanager.containerregistry.fluent.WebhooksClient; import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; @@ -60,6 +56,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * The HTTP pipeline to send requests through. */ @@ -242,62 +252,6 @@ public WebhooksClient getWebhooks() { return this.webhooks; } - /** - * The AgentPoolsClient object to access its operations. - */ - private final AgentPoolsClient agentPools; - - /** - * Gets the AgentPoolsClient object to access its operations. - * - * @return the AgentPoolsClient object. - */ - public AgentPoolsClient getAgentPools() { - return this.agentPools; - } - - /** - * The RunsClient object to access its operations. - */ - private final RunsClient runs; - - /** - * Gets the RunsClient object to access its operations. - * - * @return the RunsClient object. - */ - public RunsClient getRuns() { - return this.runs; - } - - /** - * The TaskRunsClient object to access its operations. - */ - private final TaskRunsClient taskRuns; - - /** - * Gets the TaskRunsClient object to access its operations. - * - * @return the TaskRunsClient object. - */ - public TaskRunsClient getTaskRuns() { - return this.taskRuns; - } - - /** - * The TasksClient object to access its operations. - */ - private final TasksClient tasks; - - /** - * Gets the TasksClient object to access its operations. - * - * @return the TasksClient object. - */ - public TasksClient getTasks() { - return this.tasks; - } - /** * Initializes an instance of ContainerRegistryManagementClient client. * @@ -316,6 +270,7 @@ public TasksClient getTasks() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.apiVersion = "2025-11-01"; this.operations = new OperationsClientImpl(this); this.registries = new RegistriesClientImpl(this); this.cacheRules = new CacheRulesClientImpl(this); @@ -326,9 +281,5 @@ public TasksClient getTasks() { this.scopeMaps = new ScopeMapsClientImpl(this); this.tokens = new TokensClientImpl(this); this.webhooks = new WebhooksClientImpl(this); - this.agentPools = new AgentPoolsClientImpl(this); - this.runs = new RunsClientImpl(this); - this.taskRuns = new TaskRunsClientImpl(this); - this.tasks = new TasksClientImpl(this); } } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java new file mode 100644 index 000000000000..edb93ee0dff7 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientBuilder.java @@ -0,0 +1,138 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.containerregistry.implementation; + +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.util.serializer.SerializerAdapter; +import java.time.Duration; + +/** + * A builder for creating a new instance of the ContainerRegistryTasksManagementClientImpl type. + */ +@ServiceClientBuilder(serviceClients = { ContainerRegistryTasksManagementClientImpl.class }) +public final class ContainerRegistryTasksManagementClientBuilder { + /* + * The Microsoft Azure subscription ID. + */ + private String subscriptionId; + + /** + * Sets The Microsoft Azure subscription ID. + * + * @param subscriptionId the subscriptionId value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; + return this; + } + + /* + * server parameter + */ + private String endpoint; + + /** + * Sets server parameter. + * + * @param endpoint the endpoint value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * The environment to connect to + */ + private AzureEnvironment environment; + + /** + * Sets The environment to connect to. + * + * @param environment the environment value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder environment(AzureEnvironment environment) { + this.environment = environment; + return this; + } + + /* + * The HTTP pipeline to send requests through + */ + private HttpPipeline pipeline; + + /** + * Sets The HTTP pipeline to send requests through. + * + * @param pipeline the pipeline value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder pipeline(HttpPipeline pipeline) { + this.pipeline = pipeline; + return this; + } + + /* + * The default poll interval for long-running operation + */ + private Duration defaultPollInterval; + + /** + * Sets The default poll interval for long-running operation. + * + * @param defaultPollInterval the defaultPollInterval value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { + this.defaultPollInterval = defaultPollInterval; + return this; + } + + /* + * The serializer to serialize an object into a string + */ + private SerializerAdapter serializerAdapter; + + /** + * Sets The serializer to serialize an object into a string. + * + * @param serializerAdapter the serializerAdapter value. + * @return the ContainerRegistryTasksManagementClientBuilder. + */ + public ContainerRegistryTasksManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + this.serializerAdapter = serializerAdapter; + return this; + } + + /** + * Builds an instance of ContainerRegistryTasksManagementClientImpl with the provided parameters. + * + * @return an instance of ContainerRegistryTasksManagementClientImpl. + */ + public ContainerRegistryTasksManagementClientImpl buildClient() { + String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; + AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; + HttpPipeline localPipeline = (pipeline != null) + ? pipeline + : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); + Duration localDefaultPollInterval + = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter + : SerializerFactory.createDefaultManagementSerializerAdapter(); + ContainerRegistryTasksManagementClientImpl client + = new ContainerRegistryTasksManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + return client; + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java new file mode 100644 index 000000000000..bd74c82f5dc5 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ContainerRegistryTasksManagementClientImpl.java @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.containerregistry.implementation; + +import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpPipeline; +import com.azure.core.management.AzureEnvironment; +import com.azure.core.util.serializer.SerializerAdapter; +import com.azure.resourcemanager.containerregistry.fluent.AgentPoolsClient; +import com.azure.resourcemanager.containerregistry.fluent.ContainerRegistryTasksManagementClient; +import com.azure.resourcemanager.containerregistry.fluent.RegistryTasksClient; +import com.azure.resourcemanager.containerregistry.fluent.RunsClient; +import com.azure.resourcemanager.containerregistry.fluent.TaskRunsClient; +import com.azure.resourcemanager.containerregistry.fluent.TasksClient; +import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; +import java.time.Duration; + +/** + * Initializes a new instance of the ContainerRegistryTasksManagementClientImpl type. + */ +@ServiceClient(builder = ContainerRegistryTasksManagementClientBuilder.class) +public final class ContainerRegistryTasksManagementClientImpl extends AzureServiceClient + implements ContainerRegistryTasksManagementClient { + /** + * The Microsoft Azure subscription ID. + */ + private final String subscriptionId; + + /** + * Gets The Microsoft Azure subscription ID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + + /** + * server parameter. + */ + private final String endpoint; + + /** + * Gets server parameter. + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * The default poll interval for long-running operation. + */ + private final Duration defaultPollInterval; + + /** + * Gets The default poll interval for long-running operation. + * + * @return the defaultPollInterval value. + */ + public Duration getDefaultPollInterval() { + return this.defaultPollInterval; + } + + /** + * The AgentPoolsClient object to access its operations. + */ + private final AgentPoolsClient agentPools; + + /** + * Gets the AgentPoolsClient object to access its operations. + * + * @return the AgentPoolsClient object. + */ + public AgentPoolsClient getAgentPools() { + return this.agentPools; + } + + /** + * The RegistryTasksClient object to access its operations. + */ + private final RegistryTasksClient registryTasks; + + /** + * Gets the RegistryTasksClient object to access its operations. + * + * @return the RegistryTasksClient object. + */ + public RegistryTasksClient getRegistryTasks() { + return this.registryTasks; + } + + /** + * The RunsClient object to access its operations. + */ + private final RunsClient runs; + + /** + * Gets the RunsClient object to access its operations. + * + * @return the RunsClient object. + */ + public RunsClient getRuns() { + return this.runs; + } + + /** + * The TaskRunsClient object to access its operations. + */ + private final TaskRunsClient taskRuns; + + /** + * Gets the TaskRunsClient object to access its operations. + * + * @return the TaskRunsClient object. + */ + public TaskRunsClient getTaskRuns() { + return this.taskRuns; + } + + /** + * The TasksClient object to access its operations. + */ + private final TasksClient tasks; + + /** + * Gets the TasksClient object to access its operations. + * + * @return the TasksClient object. + */ + public TasksClient getTasks() { + return this.tasks; + } + + /** + * Initializes an instance of ContainerRegistryTasksManagementClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param defaultPollInterval The default poll interval for long-running operation. + * @param environment The Azure environment. + * @param subscriptionId The Microsoft Azure subscription ID. + * @param endpoint server parameter. + */ + ContainerRegistryTasksManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + super(httpPipeline, serializerAdapter, environment); + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.defaultPollInterval = defaultPollInterval; + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = "2019-06-01-preview"; + this.agentPools = new AgentPoolsClientImpl(this); + this.registryTasks = new RegistryTasksClientImpl(this); + this.runs = new RunsClientImpl(this); + this.taskRuns = new TaskRunsClientImpl(this); + this.tasks = new TasksClientImpl(this); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CredentialSetsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CredentialSetsClientImpl.java index 636294abe076..46b1d23d3622 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CredentialSetsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/CredentialSetsClientImpl.java @@ -159,11 +159,10 @@ private Mono> listSinglePageAsync(String resou if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -199,12 +198,11 @@ private Mono> listSinglePageAsync(String resou if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -311,11 +309,10 @@ public Mono> getWithResponseAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, credentialSetName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, credentialSetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -354,11 +351,10 @@ private Mono> getWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, credentialSetName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, credentialSetName, accept, context); } /** @@ -453,12 +449,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { credentialSetCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, credentialSetName, + credentialSetCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -504,11 +499,10 @@ private Mono>> createWithResponseAsync(String resource } else { credentialSetCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, credentialSetName, credentialSetCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, credentialSetName, credentialSetCreateParameters, accept, context); } /** @@ -723,12 +717,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { credentialSetUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, credentialSetName, + credentialSetUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -774,11 +767,10 @@ private Mono>> updateWithResponseAsync(String resource } else { credentialSetUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, credentialSetName, credentialSetUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, credentialSetName, credentialSetUpdateParameters, accept, context); } /** @@ -985,10 +977,9 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, credentialSetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1027,11 +1018,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter credentialSetName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, credentialSetName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, credentialSetName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java index b499c9d2df2a..70f7a93d4bf6 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/OperationsClientImpl.java @@ -91,9 +91,10 @@ private Mono> listSinglePageAsync() { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), 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())); @@ -115,10 +116,9 @@ private Mono> listSinglePageAsync(Contex return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) + return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/PrivateEndpointConnectionsClientImpl.java index ff679e12aab8..e8fbcb1e9ee0 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/PrivateEndpointConnectionsClientImpl.java @@ -148,11 +148,10 @@ private Mono> listSinglePageAsync( if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -188,12 +187,11 @@ private Mono> listSinglePageAsync( if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -302,11 +300,11 @@ public Mono> getWithResponseAsync(Strin return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, privateEndpointConnectionName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -345,11 +343,10 @@ private Mono> getWithResponseAsync(Stri return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, privateEndpointConnectionName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, privateEndpointConnectionName, accept, context); } /** @@ -449,10 +446,9 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { privateEndpointConnection.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -501,11 +497,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { privateEndpointConnection.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, + privateEndpointConnection, accept, context); } /** @@ -720,12 +716,11 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, privateEndpointConnectionName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, privateEndpointConnectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -763,11 +758,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, privateEndpointConnectionName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, privateEndpointConnectionName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java index 00481ff3eb5c..f536a0b9868a 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesClientImpl.java @@ -40,8 +40,6 @@ import com.azure.resourcemanager.containerregistry.fluent.models.RegistryListCredentialsResultInner; import com.azure.resourcemanager.containerregistry.fluent.models.RegistryNameStatusInner; import com.azure.resourcemanager.containerregistry.fluent.models.RegistryUsageListResultInner; -import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; -import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; import com.azure.resourcemanager.containerregistry.models.GenerateCredentialsParameters; import com.azure.resourcemanager.containerregistry.models.ImportImageParameters; import com.azure.resourcemanager.containerregistry.models.PrivateLinkResourceListResult; @@ -49,7 +47,6 @@ import com.azure.resourcemanager.containerregistry.models.RegistryListResult; import com.azure.resourcemanager.containerregistry.models.RegistryNameCheckRequest; import com.azure.resourcemanager.containerregistry.models.RegistryUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.RunRequest; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; @@ -220,25 +217,6 @@ Mono> regenerateCredential(@HostPar @BodyParam("application/json") RegenerateCredentialParameters regenerateCredentialParameters, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> scheduleRun(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") RunRequest runRequest, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getBuildSourceUploadUrl(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -291,11 +269,11 @@ Mono> listPrivateLinkResourcesNext( } else { registryNameCheckRequest.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.checkNameAvailability(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), registryNameCheckRequest, accept, context)) + .withContext( + context -> service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), registryNameCheckRequest, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -328,11 +306,10 @@ Mono> listPrivateLinkResourcesNext( } else { registryNameCheckRequest.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.checkNameAvailability(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - registryNameCheckRequest, accept, context); + return service.checkNameAvailability(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), registryNameCheckRequest, accept, context); } /** @@ -403,11 +380,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(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())); @@ -433,10 +409,11 @@ private Mono> listSinglePageAsync(Context context) return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) + return service + .list(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)); } @@ -518,10 +495,9 @@ private Mono> listByResourceGroupSinglePageAsync(St return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -554,12 +530,11 @@ private Mono> listByResourceGroupSinglePageAsync(St return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, accept, context) + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -653,10 +628,9 @@ public Mono> getByResourceGroupWithResponseAsync(String if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -691,11 +665,10 @@ private Mono> getByResourceGroupWithResponseAsync(String if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context); } /** @@ -781,10 +754,9 @@ public Mono>> createWithResponseAsync(String resourceG } else { registry.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, registry, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -825,11 +797,10 @@ private Mono>> createWithResponseAsync(String resource } else { registry.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, registry, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, registry, accept, context); } /** @@ -1014,12 +985,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { registryUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, registryUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, registryUpdateParameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1060,11 +1030,10 @@ private Mono>> updateWithResponseAsync(String resource } else { registryUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, registryUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, registryUpdateParameters, accept, context); } /** @@ -1244,10 +1213,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1281,11 +1249,10 @@ private Mono>> deleteWithResponseAsync(String resource if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context); } /** @@ -1454,10 +1421,9 @@ public Mono>> generateCredentialsWithResponseAsync(Str } else { generateCredentialsParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.generateCredentials(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.generateCredentials(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, generateCredentialsParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1500,11 +1466,11 @@ private Mono>> generateCredentialsWithResponseAsync(St } else { generateCredentialsParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.generateCredentials(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, generateCredentialsParameters, accept, context); + return service.generateCredentials(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, generateCredentialsParameters, accept, + context); } /** @@ -1701,10 +1667,9 @@ public Mono>> importImageWithResponseAsync(String reso } else { parameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.importImage(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.importImage(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1744,11 +1709,10 @@ private Mono>> importImageWithResponseAsync(String res } else { parameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.importImage(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, parameters, accept, context); + return service.importImage(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, parameters, accept, context); } /** @@ -1926,10 +1890,9 @@ public Mono> listCredentialsWithRes if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listCredentials(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listCredentials(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1964,11 +1927,10 @@ public Mono> listCredentialsWithRes if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listCredentials(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context); + return service.listCredentials(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context); } /** @@ -2049,10 +2011,9 @@ public Mono> listUsagesWithResponseAsync( if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listUsages(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2087,11 +2048,10 @@ private Mono> listUsagesWithResponseAsync if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listUsages(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context); + return service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context); } /** @@ -2171,11 +2131,11 @@ public RegistryUsageListResultInner listUsages(String resourceGroupName, String if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listPrivateLinkResources(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context)) + .withContext( + context -> service.listPrivateLinkResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -2211,12 +2171,11 @@ public RegistryUsageListResultInner listUsages(String resourceGroupName, String if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listPrivateLinkResources(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context) + .listPrivateLinkResources(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -2326,11 +2285,11 @@ public Mono> getPrivateLinkResourceWithRespon if (groupName == null) { return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getPrivateLinkResource(this.client.getEndpoint(), apiVersion, - this.client.getSubscriptionId(), resourceGroupName, registryName, groupName, accept, context)) + .withContext( + context -> service.getPrivateLinkResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, groupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2368,11 +2327,10 @@ private Mono> getPrivateLinkResourceWithRespo if (groupName == null) { return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getPrivateLinkResource(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, groupName, accept, context); + return service.getPrivateLinkResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, groupName, accept, context); } /** @@ -2466,10 +2424,9 @@ public Mono> regenerateCredentialWi } else { regenerateCredentialParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.regenerateCredential(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.regenerateCredential(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, regenerateCredentialParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -2514,11 +2471,11 @@ private Mono> regenerateCredentialW } else { regenerateCredentialParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.regenerateCredential(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, regenerateCredentialParameters, accept, context); + return service.regenerateCredential(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, regenerateCredentialParameters, accept, + context); } /** @@ -2579,360 +2536,6 @@ public RegistryListCredentialsResultInner regenerateCredential(String resourceGr Context.NONE).getValue(); } - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, - RunRequest runRequest) { - 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 (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); - } else { - runRequest.validate(); - } - final String apiVersion = "2019-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runRequest, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, - RunRequest runRequest, 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 (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - if (runRequest == null) { - return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); - } else { - runRequest.validate(); - } - final String apiVersion = "2019-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, runRequest, accept, context); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, - String registryName, RunRequest runRequest) { - Mono>> mono - = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, - RunInner.class, this.client.getContext()); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 PollerFlux} for polling of run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, - String registryName, RunRequest runRequest, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, - RunInner.class, context); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest) { - return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest).getSyncPoller(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, - RunRequest runRequest, Context context) { - return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).getSyncPoller(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest, - Context context) { - return beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { - return scheduleRunAsync(resourceGroupName, registryName, runRequest).block(); - } - - /** - * Schedules a new run based on the request parameters and add it to the run queue. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @param runRequest The parameters of a run that needs to scheduled. - * @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 run resource properties. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context) { - return scheduleRunAsync(resourceGroupName, registryName, runRequest, context).block(); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @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 upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName) { - 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 (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-06-01-preview"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getBuildSourceUploadUrl(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, registryName, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @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 upload location for the user to be able to upload the source along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName, 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 (registryName == null) { - return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); - } - final String apiVersion = "2019-06-01-preview"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, accept, context); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @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 upload location for the user to be able to upload the source on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getBuildSourceUploadUrlAsync(String resourceGroupName, - String registryName) { - return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @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 upload location for the user to be able to upload the source along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, - String registryName, Context context) { - return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName, context).block(); - } - - /** - * Get the upload location for the user to be able to upload the source. - * - * @param resourceGroupName The name of the resource group to which the container registry belongs. - * @param registryName The name of the container registry. - * @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 upload location for the user to be able to upload the source. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { - return getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); - } - /** * Get the next page of items. * diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java index bfbf3b9211fd..2867b40f313b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistriesImpl.java @@ -162,8 +162,8 @@ public SourceUploadDefinition getBuildSourceUploadUrl(String rgName, String acrN @Override public Mono getBuildSourceUploadUrlAsync(String rgName, String acrName) { return this.manager() - .serviceClient() - .getRegistries() + .taskClient() + .getRegistryTasks() .getBuildSourceUploadUrlAsync(rgName, acrName) .map(sourceUploadDefinitionInner -> new SourceUploadDefinitionImpl(sourceUploadDefinitionInner)); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java index b6d4bb69378e..5f685c119992 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryImpl.java @@ -249,8 +249,8 @@ public SourceUploadDefinition getBuildSourceUploadUrl() { @Override public Mono getBuildSourceUploadUrlAsync() { return this.manager() - .serviceClient() - .getRegistries() + .taskClient() + .getRegistryTasks() .getBuildSourceUploadUrlAsync(this.resourceGroupName(), this.name()) .map(sourceUploadDefinitionInner -> new SourceUploadDefinitionImpl(sourceUploadDefinitionInner)); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java index 9085bbb22681..3ca87965c994 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskImpl.java @@ -178,14 +178,14 @@ public Map sourceTriggers() { } RegistryTaskImpl(ContainerRegistryManager registryManager, String taskName) { - this.tasksInner = registryManager.serviceClient().getTasks(); + this.tasksInner = registryManager.taskClient().getTasks(); this.taskName = taskName; this.inner = new TaskInner(); this.taskUpdateParameters = new TaskUpdateParameters(); } RegistryTaskImpl(ContainerRegistryManager registryManager, TaskInner inner) { - this.tasksInner = registryManager.serviceClient().getTasks(); + this.tasksInner = registryManager.taskClient().getTasks(); this.taskName = inner.name(); this.inner = inner; this.resourceGroupName = ResourceUtils.groupFromResourceId(this.inner.id()); diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java index 74f6dd2c2440..1339b2b72bf9 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunImpl.java @@ -4,7 +4,7 @@ import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.containerregistry.ContainerRegistryManager; -import com.azure.resourcemanager.containerregistry.fluent.RegistriesClient; +import com.azure.resourcemanager.containerregistry.fluent.RegistryTasksClient; import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; import com.azure.resourcemanager.containerregistry.models.AgentProperties; import com.azure.resourcemanager.containerregistry.models.Architecture; @@ -40,7 +40,7 @@ class RegistryTaskRunImpl implements RegistryTaskRun, RegistryTaskRun.Definition private String resourceGroupName; private String registryName; private RunInner inner; - private RegistriesClient registriesInner; + private RegistryTasksClient registryTasksClient; private FileTaskRunRequest fileTaskRunRequest; private EncodedTaskRunRequest encodedTaskRunRequest; private DockerBuildRequest dockerTaskRunRequest; @@ -116,7 +116,7 @@ public String runId() { RegistryTaskRunImpl(ContainerRegistryManager registryManager, RunInner runInner) { this.registryManager = registryManager; - this.registriesInner = registryManager.serviceClient().getRegistries(); + this.registryTasksClient = registryManager.taskClient().getRegistryTasks(); this.platform = new PlatformProperties(); this.inner = runInner; @@ -301,28 +301,28 @@ public RegistryTaskRun execute() { public Mono executeAsync() { final RegistryTaskRunImpl self = this; if (this.fileTaskRunRequest != null) { - return this.registriesInner + return this.registryTasksClient .scheduleRunAsync(this.resourceGroupName(), this.registryName(), this.fileTaskRunRequest) .map(runInner -> { self.inner = runInner; return self; }); } else if (this.encodedTaskRunRequest != null) { - return this.registriesInner + return this.registryTasksClient .scheduleRunAsync(this.resourceGroupName(), this.registryName(), this.encodedTaskRunRequest) .map(runInner -> { self.inner = runInner; return self; }); } else if (this.dockerTaskRunRequest != null) { - return this.registriesInner + return this.registryTasksClient .scheduleRunAsync(this.resourceGroupName(), this.registryName(), this.dockerTaskRunRequest) .map(runInner -> { self.inner = runInner; return self; }); } else if (this.taskRunRequest != null) { - return this.registriesInner + return this.registryTasksClient .scheduleRunAsync(this.resourceGroupName(), this.registryName(), this.taskRunRequest) .map(runInner -> { self.inner = runInner; @@ -365,7 +365,7 @@ public RegistryTaskRun refresh() { @Override public Mono refreshAsync() { final RegistryTaskRunImpl self = this; - return registryManager.serviceClient() + return registryManager.taskClient() .getRuns() .getAsync(this.resourceGroupName(), this.registryName(), this.inner.runId()) .map(runInner -> { diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java index ce17ba64d1dc..575d5d6310dd 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTaskRunsImpl.java @@ -26,7 +26,7 @@ public RegistryTaskRun.DefinitionStages.BlankFromRuns scheduleRun() { @Override public PagedFlux listByRegistryAsync(String rgName, String acrName) { - return PagedConverter.mapPage(this.registryManager.serviceClient().getRuns().listAsync(rgName, acrName), + return PagedConverter.mapPage(this.registryManager.taskClient().getRuns().listAsync(rgName, acrName), inner -> wrapModel(inner)); } @@ -37,7 +37,7 @@ public PagedIterable listByRegistry(String rgName, String acrNa @Override public Mono getLogSasUrlAsync(String rgName, String acrName, String runId) { - return this.registryManager.serviceClient() + return this.registryManager.taskClient() .getRuns() .getLogSasUrlAsync(rgName, acrName, runId) .map(runGetLogResultInner -> runGetLogResultInner.logLink()); @@ -50,7 +50,7 @@ public String getLogSasUrl(String rgName, String acrName, String runId) { @Override public Mono cancelAsync(String rgName, String acrName, String runId) { - return this.registryManager.serviceClient().getRuns().cancelAsync(rgName, acrName, runId); + return this.registryManager.taskClient().getRuns().cancelAsync(rgName, acrName, runId); } @Override diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java new file mode 100644 index 000000000000..7c269a625297 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksClientImpl.java @@ -0,0 +1,437 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.resourcemanager.containerregistry.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.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.containerregistry.fluent.RegistryTasksClient; +import com.azure.resourcemanager.containerregistry.fluent.models.RunInner; +import com.azure.resourcemanager.containerregistry.fluent.models.SourceUploadDefinitionInner; +import com.azure.resourcemanager.containerregistry.models.RunRequest; +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 RegistryTasksClient. + */ +public final class RegistryTasksClientImpl implements RegistryTasksClient { + /** + * The proxy service used to perform REST calls. + */ + private final RegistryTasksService service; + + /** + * The service client containing this operation class. + */ + private final ContainerRegistryTasksManagementClientImpl client; + + /** + * Initializes an instance of RegistryTasksClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + RegistryTasksClientImpl(ContainerRegistryTasksManagementClientImpl client) { + this.service + = RestProxy.create(RegistryTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for ContainerRegistryTasksManagementClientRegistryTasks to be used by the + * proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientRegistryTasks") + public interface RegistryTasksService { + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> scheduleRun(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") RunRequest runRequest, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBuildSourceUploadUrl(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("registryName") String registryName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, + RunRequest runRequest) { + 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 (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); + } else { + runRequest.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), runRequest, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> scheduleRunWithResponseAsync(String resourceGroupName, String registryName, + RunRequest runRequest, 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 (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + if (runRequest == null) { + return Mono.error(new IllegalArgumentException("Parameter runRequest is required and cannot be null.")); + } else { + runRequest.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.scheduleRun(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), runRequest, accept, context); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, + String registryName, RunRequest runRequest) { + Mono>> mono + = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, + RunInner.class, this.client.getContext()); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 PollerFlux} for polling of run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, RunInner> beginScheduleRunAsync(String resourceGroupName, + String registryName, RunRequest runRequest, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = scheduleRunWithResponseAsync(resourceGroupName, registryName, runRequest, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), RunInner.class, + RunInner.class, context); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, + RunRequest runRequest) { + return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest).getSyncPoller(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, RunInner> beginScheduleRun(String resourceGroupName, String registryName, + RunRequest runRequest, Context context) { + return this.beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).getSyncPoller(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest) { + return beginScheduleRunAsync(resourceGroupName, registryName, runRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono scheduleRunAsync(String resourceGroupName, String registryName, RunRequest runRequest, + Context context) { + return beginScheduleRunAsync(resourceGroupName, registryName, runRequest, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest) { + return scheduleRunAsync(resourceGroupName, registryName, runRequest).block(); + } + + /** + * Schedules a new run based on the request parameters and add it to the run queue. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @param runRequest The parameters of a run that needs to scheduled. + * @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 run resource properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RunInner scheduleRun(String resourceGroupName, String registryName, RunRequest runRequest, Context context) { + return scheduleRunAsync(resourceGroupName, registryName, runRequest, context).block(); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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 upload location for the user to be able to upload the source along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName) { + 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 (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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 upload location for the user to be able to upload the source along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + getBuildSourceUploadUrlWithResponseAsync(String resourceGroupName, String registryName, 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 (registryName == null) { + return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getBuildSourceUploadUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, registryName, this.client.getApiVersion(), accept, context); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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 upload location for the user to be able to upload the source on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getBuildSourceUploadUrlAsync(String resourceGroupName, + String registryName) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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 upload location for the user to be able to upload the source along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getBuildSourceUploadUrlWithResponse(String resourceGroupName, + String registryName, Context context) { + return getBuildSourceUploadUrlWithResponseAsync(resourceGroupName, registryName, context).block(); + } + + /** + * Get the upload location for the user to be able to upload the source. + * + * @param resourceGroupName The name of the resource group to which the container registry belongs. + * @param registryName The name of the container registry. + * @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 upload location for the user to be able to upload the source. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SourceUploadDefinitionInner getBuildSourceUploadUrl(String resourceGroupName, String registryName) { + return getBuildSourceUploadUrlWithResponse(resourceGroupName, registryName, Context.NONE).getValue(); + } +} diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java index 573db6b801cd..acee3739c8ad 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RegistryTasksImpl.java @@ -29,7 +29,7 @@ public RegistryTask.DefinitionStages.Blank define(String name) { @Override public PagedFlux listByRegistryAsync(String resourceGroupName, String registryName) { return PagedConverter.mapPage( - this.registryManager.serviceClient().getTasks().listAsync(resourceGroupName, registryName), + this.registryManager.taskClient().getTasks().listAsync(resourceGroupName, registryName), inner -> wrapModel(inner)); } @@ -42,12 +42,12 @@ public PagedIterable listByRegistry(String resourceGroupName, Stri public Mono getByRegistryAsync(String resourceGroupName, String registryName, String taskName, boolean includeSecrets) { if (includeSecrets) { - return this.registryManager.serviceClient() + return this.registryManager.taskClient() .getTasks() .getDetailsAsync(resourceGroupName, registryName, taskName) .map(taskInner -> new RegistryTaskImpl(registryManager, taskInner)); } else { - return this.registryManager.serviceClient() + return this.registryManager.taskClient() .getTasks() .getAsync(resourceGroupName, registryName, taskName) .map(taskInner -> new RegistryTaskImpl(registryManager, taskInner)); @@ -62,7 +62,7 @@ public RegistryTask getByRegistry(String resourceGroupName, String registryName, @Override public Mono deleteByRegistryAsync(String resourceGroupName, String registryName, String taskName) { - return this.registryManager.serviceClient().getTasks().deleteAsync(resourceGroupName, registryName, taskName); + return this.registryManager.taskClient().getTasks().deleteAsync(resourceGroupName, registryName, taskName); } @Override @@ -75,6 +75,6 @@ private RegistryTaskImpl wrapModel(TaskInner innerModel) { } public TasksClient inner() { - return this.registryManager.serviceClient().getTasks(); + return this.registryManager.taskClient().getTasks(); } } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java index b123d623d553..1eb0e3ca8416 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ReplicationsClientImpl.java @@ -159,11 +159,10 @@ private Mono> listSinglePageAsync(String resourc if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -199,12 +198,11 @@ private Mono> listSinglePageAsync(String resourc if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -311,11 +309,10 @@ public Mono> getWithResponseAsync(String resourceGrou return Mono .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, replicationName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -354,11 +351,10 @@ private Mono> getWithResponseAsync(String resourceGro return Mono .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, replicationName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, replicationName, accept, context); } /** @@ -452,12 +448,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { replication.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, replicationName, replication, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, replication, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -502,11 +497,10 @@ private Mono>> createWithResponseAsync(String resource } else { replication.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, replicationName, replication, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, replicationName, replication, accept, context); } /** @@ -710,12 +704,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { replicationUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, replicationName, replicationUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, + replicationUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -761,11 +754,10 @@ private Mono>> updateWithResponseAsync(String resource } else { replicationUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, replicationName, replicationUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, replicationName, replicationUpdateParameters, accept, context); } /** @@ -967,10 +959,9 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, replicationName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1009,11 +1000,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter replicationName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, replicationName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, replicationName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java index 5fcefe716dda..938a2a8cdd98 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/RunsClientImpl.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.implementation; @@ -52,24 +51,24 @@ public final class RunsClientImpl implements RunsClient { /** * The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; + private final ContainerRegistryTasksManagementClientImpl client; /** * Initializes an instance of RunsClientImpl. * * @param client the instance of the service client containing this operation class. */ - RunsClientImpl(ContainerRegistryManagementClientImpl client) { + RunsClientImpl(ContainerRegistryTasksManagementClientImpl client) { this.service = RestProxy.create(RunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ContainerRegistryManagementClientRuns to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for ContainerRegistryTasksManagementClientRuns to be used by the proxy + * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryManagementClientRuns") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientRuns") public interface RunsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs") @@ -161,11 +160,10 @@ private Mono> listSinglePageAsync(String resourceGroupNa if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, filter, top, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), filter, top, 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())); @@ -203,12 +201,11 @@ private Mono> listSinglePageAsync(String resourceGroupNa if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, filter, top, accept, context) + this.client.getApiVersion(), filter, top, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -340,11 +337,10 @@ public Mono> getWithResponseAsync(String resourceGroupName, S if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runId, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), runId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -382,11 +378,10 @@ private Mono> getWithResponseAsync(String resourceGroupName, if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, runId, accept, context); + this.client.getApiVersion(), runId, accept, context); } /** @@ -479,11 +474,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { runUpdateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runId, runUpdateParameters, accept, context)) + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), runId, runUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -527,11 +522,10 @@ private Mono>> updateWithResponseAsync(String resource } else { runUpdateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, runId, runUpdateParameters, accept, context); + registryName, this.client.getApiVersion(), runId, runUpdateParameters, accept, context); } /** @@ -724,11 +718,10 @@ public Mono> getLogSasUrlWithResponseAsync(String if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getLogSasUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runId, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), runId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -765,11 +758,10 @@ private Mono> getLogSasUrlWithResponseAsync(Strin if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getLogSasUrl(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, runId, accept, context); + registryName, this.client.getApiVersion(), runId, accept, context); } /** @@ -855,11 +847,10 @@ public Mono>> cancelWithResponseAsync(String resourceG if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, runId, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), runId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -896,11 +887,10 @@ private Mono>> cancelWithResponseAsync(String resource if (runId == null) { return Mono.error(new IllegalArgumentException("Parameter runId is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.cancel(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, runId, accept, context); + registryName, this.client.getApiVersion(), runId, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ScopeMapsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ScopeMapsClientImpl.java index ec4f85ae763d..1228c61f93db 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ScopeMapsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/ScopeMapsClientImpl.java @@ -157,11 +157,10 @@ private Mono> listSinglePageAsync(String resourceGr if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -197,12 +196,11 @@ private Mono> listSinglePageAsync(String resourceGr if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -308,11 +306,10 @@ public Mono> getWithResponseAsync(String resourceGroupNa if (scopeMapName == null) { return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, scopeMapName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, scopeMapName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -350,11 +347,10 @@ private Mono> getWithResponseAsync(String resourceGroupN if (scopeMapName == null) { return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, scopeMapName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, scopeMapName, accept, context); } /** @@ -448,12 +444,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { scopeMapCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, scopeMapName, + scopeMapCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -498,11 +493,10 @@ private Mono>> createWithResponseAsync(String resource } else { scopeMapCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, scopeMapName, scopeMapCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, scopeMapName, scopeMapCreateParameters, accept, context); } /** @@ -704,12 +698,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { scopeMapUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, scopeMapName, + scopeMapUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -754,11 +747,10 @@ private Mono>> updateWithResponseAsync(String resource } else { scopeMapUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, scopeMapName, scopeMapUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, scopeMapName, scopeMapUpdateParameters, accept, context); } /** @@ -952,10 +944,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (scopeMapName == null) { return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, scopeMapName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -993,11 +984,10 @@ private Mono>> deleteWithResponseAsync(String resource if (scopeMapName == null) { return Mono.error(new IllegalArgumentException("Parameter scopeMapName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, scopeMapName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, scopeMapName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java index de584279d1a3..2a64d7951e51 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TaskRunsClientImpl.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.implementation; @@ -53,24 +52,24 @@ public final class TaskRunsClientImpl implements TaskRunsClient { /** * The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; + private final ContainerRegistryTasksManagementClientImpl client; /** * Initializes an instance of TaskRunsClientImpl. * * @param client the instance of the service client containing this operation class. */ - TaskRunsClientImpl(ContainerRegistryManagementClientImpl client) { + TaskRunsClientImpl(ContainerRegistryTasksManagementClientImpl client) { this.service = RestProxy.create(TaskRunsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ContainerRegistryManagementClientTaskRuns to be used by the proxy - * service to perform REST calls. + * The interface defining all the services for ContainerRegistryTasksManagementClientTaskRuns to be used by the + * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryManagementClientTaskRuns") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientTaskRuns") public interface TaskRunsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}") @@ -173,11 +172,10 @@ public Mono> getWithResponseAsync(String resourceGroupNam if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -215,11 +213,10 @@ private Mono> getWithResponseAsync(String resourceGroupNa if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, taskRunName, accept, context); + this.client.getApiVersion(), taskRunName, accept, context); } /** @@ -312,11 +309,10 @@ public Mono>> createWithResponseAsync(String resourceG } else { taskRun.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, taskRun, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, taskRun, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -360,11 +356,10 @@ private Mono>> createWithResponseAsync(String resource } else { taskRun.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskRunName, taskRun, accept, context); + registryName, this.client.getApiVersion(), taskRunName, taskRun, accept, context); } /** @@ -556,11 +551,10 @@ public Mono>> deleteWithResponseAsync(String resourceG if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -597,11 +591,10 @@ private Mono>> deleteWithResponseAsync(String resource if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskRunName, accept, context); + registryName, this.client.getApiVersion(), taskRunName, accept, context); } /** @@ -786,11 +779,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { updateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, updateParameters, accept, context)) + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), taskRunName, updateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -835,11 +828,10 @@ private Mono>> updateWithResponseAsync(String resource } else { updateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskRunName, updateParameters, accept, context); + registryName, this.client.getApiVersion(), taskRunName, updateParameters, accept, context); } /** @@ -1033,11 +1025,10 @@ public Mono> getDetailsWithResponseAsync(String resourceG if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskRunName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskRunName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1075,11 +1066,10 @@ private Mono> getDetailsWithResponseAsync(String resource if (taskRunName == null) { return Mono.error(new IllegalArgumentException("Parameter taskRunName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskRunName, accept, context); + registryName, this.client.getApiVersion(), taskRunName, accept, context); } /** @@ -1161,11 +1151,10 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), 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())); @@ -1200,12 +1189,11 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, accept, context) + this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java index 3b9b2c075e77..8d6e084fb4c1 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TasksClientImpl.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.implementation; @@ -53,24 +52,24 @@ public final class TasksClientImpl implements TasksClient { /** * The service client containing this operation class. */ - private final ContainerRegistryManagementClientImpl client; + private final ContainerRegistryTasksManagementClientImpl client; /** * Initializes an instance of TasksClientImpl. * * @param client the instance of the service client containing this operation class. */ - TasksClientImpl(ContainerRegistryManagementClientImpl client) { + TasksClientImpl(ContainerRegistryTasksManagementClientImpl client) { this.service = RestProxy.create(TasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for ContainerRegistryManagementClientTasks to be used by the proxy + * The interface defining all the services for ContainerRegistryTasksManagementClientTasks to be used by the proxy * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "ContainerRegistryManagementClientTasks") + @ServiceInterface(name = "ContainerRegistryTasksManagementClientTasks") public interface TasksService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks") @@ -168,11 +167,10 @@ private Mono> listSinglePageAsync(String resourceGroupN if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), 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())); @@ -207,12 +205,11 @@ private Mono> listSinglePageAsync(String resourceGroupN if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, accept, context) + this.client.getApiVersion(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -313,11 +310,10 @@ public Mono> getWithResponseAsync(String resourceGroupName, if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -354,11 +350,10 @@ private Mono> getWithResponseAsync(String resourceGroupName, if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, registryName, - apiVersion, taskName, accept, context); + this.client.getApiVersion(), taskName, accept, context); } /** @@ -452,11 +447,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { taskCreateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, taskCreateParameters, accept, context)) + .withContext( + context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), taskName, taskCreateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -501,11 +496,10 @@ private Mono>> createWithResponseAsync(String resource } else { taskCreateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskName, taskCreateParameters, accept, context); + registryName, this.client.getApiVersion(), taskName, taskCreateParameters, accept, context); } /** @@ -698,11 +692,10 @@ public Mono>> deleteWithResponseAsync(String resourceG if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -739,11 +732,10 @@ private Mono>> deleteWithResponseAsync(String resource if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskName, accept, context); + registryName, this.client.getApiVersion(), taskName, accept, context); } /** @@ -928,11 +920,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { taskUpdateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, taskUpdateParameters, accept, context)) + .withContext( + context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + registryName, this.client.getApiVersion(), taskName, taskUpdateParameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -977,11 +969,10 @@ private Mono>> updateWithResponseAsync(String resource } else { taskUpdateParameters.validate(); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskName, taskUpdateParameters, accept, context); + registryName, this.client.getApiVersion(), taskName, taskUpdateParameters, accept, context); } /** @@ -1175,11 +1166,10 @@ public Mono> getDetailsWithResponseAsync(String resourceGrou if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, registryName, apiVersion, taskName, accept, context)) + resourceGroupName, registryName, this.client.getApiVersion(), taskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1217,11 +1207,10 @@ private Mono> getDetailsWithResponseAsync(String resourceGro if (taskName == null) { return Mono.error(new IllegalArgumentException("Parameter taskName is required and cannot be null.")); } - final String apiVersion = "2019-06-01-preview"; final String accept = "application/json"; context = this.client.mergeContext(context); return service.getDetails(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - registryName, apiVersion, taskName, accept, context); + registryName, this.client.getApiVersion(), taskName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TokensClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TokensClientImpl.java index 663188f8932d..d79c1f67e496 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TokensClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/TokensClientImpl.java @@ -155,11 +155,10 @@ private Mono> listSinglePageAsync(String resourceGroup if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -195,12 +194,11 @@ private Mono> listSinglePageAsync(String resourceGroup if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -306,11 +304,10 @@ public Mono> getWithResponseAsync(String resourceGroupName, if (tokenName == null) { return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, tokenName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, tokenName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -348,11 +345,10 @@ private Mono> getWithResponseAsync(String resourceGroupName if (tokenName == null) { return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, tokenName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, tokenName, accept, context); } /** @@ -446,12 +442,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { tokenCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, tokenName, tokenCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, tokenName, tokenCreateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -496,11 +491,10 @@ private Mono>> createWithResponseAsync(String resource } else { tokenCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, tokenName, tokenCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, tokenName, tokenCreateParameters, accept, context); } /** @@ -701,12 +695,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { tokenUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, tokenName, tokenUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, tokenName, tokenUpdateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -751,11 +744,10 @@ private Mono>> updateWithResponseAsync(String resource } else { tokenUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, tokenName, tokenUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, tokenName, tokenUpdateParameters, accept, context); } /** @@ -948,10 +940,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (tokenName == null) { return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, tokenName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -989,11 +980,10 @@ private Mono>> deleteWithResponseAsync(String resource if (tokenName == null) { return Mono.error(new IllegalArgumentException("Parameter tokenName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, tokenName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, tokenName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java index a18198403ca3..1c9f03ed1b48 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/implementation/WebhooksClientImpl.java @@ -196,11 +196,10 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, 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())); @@ -236,12 +235,11 @@ private Mono> listSinglePageAsync(String resourceGro if (registryName == null) { return Mono.error(new IllegalArgumentException("Parameter registryName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, accept, context) + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -347,11 +345,10 @@ public Mono> getWithResponseAsync(String resourceGroupNam if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -389,11 +386,10 @@ private Mono> getWithResponseAsync(String resourceGroupNa if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, accept, context); } /** @@ -487,12 +483,11 @@ public Mono>> createWithResponseAsync(String resourceG } else { webhookCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, webhookCreateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, webhookCreateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -537,11 +532,10 @@ private Mono>> createWithResponseAsync(String resource } else { webhookCreateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, webhookCreateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, webhookCreateParameters, accept, context); } /** @@ -743,12 +737,11 @@ public Mono>> updateWithResponseAsync(String resourceG } else { webhookUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, webhookUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, webhookUpdateParameters, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -793,11 +786,10 @@ private Mono>> updateWithResponseAsync(String resource } else { webhookUpdateParameters.validate(); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, webhookUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, webhookUpdateParameters, accept, context); } /** @@ -991,10 +983,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1032,11 +1023,10 @@ private Mono>> deleteWithResponseAsync(String resource if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, accept, context); } /** @@ -1214,10 +1204,9 @@ public Mono> getCallbackConfigWithResponseAsync(St if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getCallbackConfig(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.getCallbackConfig(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1256,11 +1245,10 @@ private Mono> getCallbackConfigWithResponseAsync(S if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getCallbackConfig(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, accept, context); + return service.getCallbackConfig(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context); } /** @@ -1349,10 +1337,9 @@ private Mono> listEventsSinglePageAsync(String resourc if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listEvents(this.client.getEndpoint(), apiVersion, + .withContext(context -> service.listEvents(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) @@ -1393,12 +1380,11 @@ private Mono> listEventsSinglePageAsync(String resourc if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listEvents(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, accept, context) + .listEvents(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1505,11 +1491,10 @@ public Mono> pingWithResponseAsync(String resourceGroup if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.ping(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - resourceGroupName, registryName, webhookName, accept, context)) + .withContext(context -> service.ping(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, registryName, webhookName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1546,11 +1531,10 @@ private Mono> pingWithResponseAsync(String resourceGrou if (webhookName == null) { return Mono.error(new IllegalArgumentException("Parameter webhookName is required and cannot be null.")); } - final String apiVersion = "2025-11-01"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.ping(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, - registryName, webhookName, accept, context); + return service.ping(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, registryName, webhookName, accept, context); } /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentPoolListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentPoolListResult.java index 14bbce22749a..4107648b7cf5 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentPoolListResult.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentPoolListResult.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentPoolUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentPoolUpdateParameters.java index cbed20caf2ee..cbe990e89f3d 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentPoolUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentPoolUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentProperties.java index 31a4efec656f..8f03d158e8b5 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AgentProperties.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Architecture.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Architecture.java index 355b94c90478..8657b341064f 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Architecture.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Architecture.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Argument.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Argument.java index 54f7f0e77ce3..8f3da1c02891 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Argument.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Argument.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfo.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfo.java index 839ae00deab9..d6c8981b21c6 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfo.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfo.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfoUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfoUpdateParameters.java index 6409c4258e69..6d675bb90138 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfoUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/AuthInfoUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependency.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependency.java index 0c4f167a6010..4794ad58d6c6 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependency.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependency.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependencyType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependencyType.java index caff5828a7c7..cb3f35ef5bf5 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependencyType.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageDependencyType.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTrigger.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTrigger.java index 6b1f08d2b26b..b2a74bb6efc0 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTrigger.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTrigger.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerType.java index 7835bfd6b417..6a0382ec8375 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerType.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerType.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerUpdateParameters.java index 143009302885..33502da767ce 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/BaseImageTriggerUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Credentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Credentials.java index 0caa77244764..7acf9d084c58 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Credentials.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Credentials.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CustomRegistryCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CustomRegistryCredentials.java index 1ffc32fa49ff..7f88a9dc49a0 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CustomRegistryCredentials.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/CustomRegistryCredentials.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildRequest.java index 028c8e5e1070..26ffaea2d80e 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildRequest.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildRequest.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildStepUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildStepUpdateParameters.java index 489d63b375ee..e817bdebdf45 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildStepUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerBuildStepUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerTaskStep.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerTaskStep.java index 82c7597c7d53..42e466797215 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerTaskStep.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/DockerTaskStep.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskRunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskRunRequest.java index b93b182027eb..728bccb2cafc 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskRunRequest.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskRunRequest.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStep.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStep.java index c57f84c4c215..823d88f11226 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStep.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStep.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStepUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStepUpdateParameters.java index 1735b36c3bfe..3910a695c096 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStepUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/EncodedTaskStepUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskRunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskRunRequest.java index c4f674dd6c22..874228fab75e 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskRunRequest.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskRunRequest.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStep.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStep.java index f76be756e7d5..b302ab026da4 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStep.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStep.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStepUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStepUpdateParameters.java index 126929f33f1c..5d81161720ee 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStepUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/FileTaskStepUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageDescriptor.java index 4af508238fa3..a673ae1a7514 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageDescriptor.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageDescriptor.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageUpdateTrigger.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageUpdateTrigger.java index 6952e8baf084..0c7f6662360a 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageUpdateTrigger.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ImageUpdateTrigger.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OS.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OS.java index 117afd982c55..097cefdafecc 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OS.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OS.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverrideTaskStepProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverrideTaskStepProperties.java index 3d5fce015606..0c934cc38018 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverrideTaskStepProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/OverrideTaskStepProperties.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformProperties.java index 3f0632037ab9..7a6a0e369464 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformProperties.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformUpdateParameters.java index 436b1e2926dc..99bfe5a926b5 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/PlatformUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ProvisioningState.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ProvisioningState.java index 74f0938cfd6f..40132038f31f 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ProvisioningState.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/ProvisioningState.java @@ -8,7 +8,7 @@ import java.util.Collection; /** - * The provisioning state of this agent pool. + * The provisioning state of the archive at the time the operation was called. */ public final class ProvisioningState extends ExpandableStringEnum { /** diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java index af303c2cf5ae..2f15dc8bb79f 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunListResult.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java index d247c4287417..32665aae20d2 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunRequest.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunStatus.java index eb9ba6ebd9dd..0a2fc5f6a8d4 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunStatus.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunStatus.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunType.java index cbf89cc2e557..2941d9b0be1d 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunType.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunType.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunUpdateParameters.java index 0c26e97f3ef7..b862890d4373 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/RunUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObject.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObject.java index 2f8b600b45fa..70746ee31170 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObject.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObject.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObjectType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObjectType.java index f9de3d6b2aaf..0e842ca2c662 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObjectType.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SecretObjectType.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SetValue.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SetValue.java index 57ca268c4bd2..a914920c98a2 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SetValue.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SetValue.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceControlType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceControlType.java index 26cecaceff66..994295b43ae9 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceControlType.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceControlType.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceProperties.java index bcaa43e55180..24409f759c33 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceProperties.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java index 90964849843a..df35808ccd5c 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryCredentials.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryLoginMode.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryLoginMode.java index 7d3ca9763175..66c1f73daf33 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryLoginMode.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceRegistryLoginMode.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTrigger.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTrigger.java index 30270c2eeb84..3c349c434d66 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTrigger.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTrigger.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerDescriptor.java index 2389279af88e..c708bc286ee3 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerDescriptor.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerDescriptor.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerEvent.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerEvent.java index e6f646a699a2..dc549410e0f1 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerEvent.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerEvent.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerUpdateParameters.java index 45df39764d69..4742540eb20d 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceTriggerUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUpdateParameters.java index 50959928987f..d3dea4d3299b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/SourceUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StepType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StepType.java index 3088931e1924..dec63129e57b 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StepType.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/StepType.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskListResult.java index 8380dd92e846..146fc8e7f326 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskListResult.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskListResult.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunListResult.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunListResult.java index 3caadb30ec4b..f90416951f16 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunListResult.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunListResult.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunRequest.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunRequest.java index 928c43db429b..c8a19a3d291d 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunRequest.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunRequest.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunUpdateParameters.java index 269b12a197c3..558835cbfd79 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskRunUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStatus.java index 8326919b7bf4..91a46f163100 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStatus.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStatus.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java index 3799b9be1c3d..ffa87d1b9d11 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepProperties.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepUpdateParameters.java index ca371564c789..1cbbb744d514 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskStepUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskUpdateParameters.java index 02f5e594f9e8..8a6584deb6d2 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TaskUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTrigger.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTrigger.java index ca43440a93cf..4aa43aea7338 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTrigger.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTrigger.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerDescriptor.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerDescriptor.java index 62355aba68ba..af635bf26061 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerDescriptor.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerDescriptor.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerUpdateParameters.java index 2d2db7dd256a..448639311e5d 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TimerTriggerUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TokenType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TokenType.java index ddf50c557f4e..9f8345b2a650 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TokenType.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TokenType.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerProperties.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerProperties.java index 387ebd950c56..b0369e3a2a52 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerProperties.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerProperties.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerStatus.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerStatus.java index 9ea52ea90d99..da23d272d08a 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerStatus.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerStatus.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerUpdateParameters.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerUpdateParameters.java index fbc0b88997f0..c906a9e6cf45 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerUpdateParameters.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/TriggerUpdateParameters.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UpdateTriggerPayloadType.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UpdateTriggerPayloadType.java index e3d5fed362a5..d902bf0d5a07 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UpdateTriggerPayloadType.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/UpdateTriggerPayloadType.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Variant.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Variant.java index 5b63690fd1f8..0f2b02295d2f 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Variant.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/java/com/azure/resourcemanager/containerregistry/models/Variant.java @@ -1,6 +1,5 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. package com.azure.resourcemanager.containerregistry.models; diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json index a0b8e920e049..4bcc116332bd 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-containerregistry/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.containerregistry.implementation.AgentPoolsClientImpl$AgentPoolsService"],["com.azure.resourcemanager.containerregistry.implementation.CacheRulesClientImpl$CacheRulesService"],["com.azure.resourcemanager.containerregistry.implementation.ConnectedRegistriesClientImpl$ConnectedRegistriesService"],["com.azure.resourcemanager.containerregistry.implementation.CredentialSetsClientImpl$CredentialSetsService"],["com.azure.resourcemanager.containerregistry.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.containerregistry.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.containerregistry.implementation.RegistriesClientImpl$RegistriesService"],["com.azure.resourcemanager.containerregistry.implementation.ReplicationsClientImpl$ReplicationsService"],["com.azure.resourcemanager.containerregistry.implementation.RunsClientImpl$RunsService"],["com.azure.resourcemanager.containerregistry.implementation.ScopeMapsClientImpl$ScopeMapsService"],["com.azure.resourcemanager.containerregistry.implementation.TaskRunsClientImpl$TaskRunsService"],["com.azure.resourcemanager.containerregistry.implementation.TasksClientImpl$TasksService"],["com.azure.resourcemanager.containerregistry.implementation.TokensClientImpl$TokensService"],["com.azure.resourcemanager.containerregistry.implementation.WebhooksClientImpl$WebhooksService"]] \ No newline at end of file +[["com.azure.resourcemanager.containerregistry.implementation.CacheRulesClientImpl$CacheRulesService"],["com.azure.resourcemanager.containerregistry.implementation.ConnectedRegistriesClientImpl$ConnectedRegistriesService"],["com.azure.resourcemanager.containerregistry.implementation.CredentialSetsClientImpl$CredentialSetsService"],["com.azure.resourcemanager.containerregistry.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.containerregistry.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.containerregistry.implementation.RegistriesClientImpl$RegistriesService"],["com.azure.resourcemanager.containerregistry.implementation.ReplicationsClientImpl$ReplicationsService"],["com.azure.resourcemanager.containerregistry.implementation.ScopeMapsClientImpl$ScopeMapsService"],["com.azure.resourcemanager.containerregistry.implementation.TokensClientImpl$TokensService"],["com.azure.resourcemanager.containerregistry.implementation.WebhooksClientImpl$WebhooksService"]] \ No newline at end of file diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/proxy-config.json b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/proxy-config.json new file mode 100644 index 000000000000..b056823a26c0 --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/proxy-config.json @@ -0,0 +1 @@ +[["com.azure.resourcemanager.containerregistry.implementation.AgentPoolsClientImpl$AgentPoolsService"],["com.azure.resourcemanager.containerregistry.implementation.RegistryTasksClientImpl$RegistryTasksService"],["com.azure.resourcemanager.containerregistry.implementation.RunsClientImpl$RunsService"],["com.azure.resourcemanager.containerregistry.implementation.TaskRunsClientImpl$TaskRunsService"],["com.azure.resourcemanager.containerregistry.implementation.TasksClientImpl$TasksService"]] \ No newline at end of file diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/reflect-config.json b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/reflect-config.json new file mode 100644 index 000000000000..0637a088a01e --- /dev/null +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/main/resources/META-INF/native-image/com.azure.resourcemanager/containerregistry_registrytasks/reflect-config.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java index a948c2abcf85..a24d0d396ee8 100644 --- a/sdk/containerregistry/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java +++ b/sdk/containerregistry/azure-resourcemanager-containerregistry/src/test/java/com/azure/resourcemanager/containerregistry/RegistryTaskTests.java @@ -1063,7 +1063,7 @@ public void cancelAndDeleteRunsAndTasks() { Assertions.assertTrue(registryManager.registryTaskRuns().listByRegistry(rgName, acrName).stream().count() == 1); // cancelling the run we just created - registryManager.serviceClient().getRuns().cancel(rgName, acrName, registryTaskRun.runId()); + registryManager.taskClient().getRuns().cancel(rgName, acrName, registryTaskRun.runId()); boolean notCanceled = true; while (notCanceled) { diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md index 1dfa13352fd2..3ed4dee14559 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/CHANGELOG.md @@ -1,5 +1,15 @@ # Release History +## 1.3.0-beta.3 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + ## 1.3.0-beta.2 (2025-12-03) - Azure Resource Manager Container Service Fleet client library for Java. This package contains Microsoft Azure SDK for Container Service Fleet Management SDK. Azure Kubernetes Fleet Manager api client. Package api-version 2025-08-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml index 3a7fca1b426d..044dafead1f7 100644 --- a/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml +++ b/sdk/containerservicefleet/azure-resourcemanager-containerservicefleet/pom.xml @@ -14,7 +14,7 @@ com.azure.resourcemanager azure-resourcemanager-containerservicefleet - 1.3.0-beta.2 + 1.3.0-beta.3 jar Microsoft Azure SDK for Container Service Fleet Management diff --git a/sdk/core/azure-core-http-netty/pom.xml b/sdk/core/azure-core-http-netty/pom.xml index 22f355727f19..1bc538843e11 100644 --- a/sdk/core/azure-core-http-netty/pom.xml +++ b/sdk/core/azure-core-http-netty/pom.xml @@ -64,7 +64,7 @@ false false - 4.1.127.Final + 4.1.130.Final 2.0.74.Final @@ -85,49 +85,49 @@ io.netty netty-handler - 4.1.127.Final + 4.1.130.Final io.netty netty-handler-proxy - 4.1.127.Final + 4.1.130.Final io.netty netty-buffer - 4.1.127.Final + 4.1.130.Final io.netty netty-codec - 4.1.127.Final + 4.1.130.Final io.netty netty-codec-http - 4.1.127.Final + 4.1.130.Final io.netty netty-codec-http2 - 4.1.127.Final + 4.1.130.Final io.netty netty-transport-native-unix-common - 4.1.127.Final + 4.1.130.Final io.netty netty-transport-native-epoll - 4.1.127.Final + 4.1.130.Final linux-x86_64 io.netty netty-transport-native-kqueue - 4.1.127.Final + 4.1.130.Final osx-x86_64 @@ -141,13 +141,13 @@ io.projectreactor.netty reactor-netty-http - 1.2.10 + 1.2.13 io.netty netty-common - 4.1.127.Final + 4.1.130.Final @@ -209,17 +209,17 @@ io.netty:netty-tcnative-boringssl-static:[2.0.74.Final] - io.projectreactor.netty:reactor-netty-http:[1.2.10] - io.netty:netty-buffer:[4.1.127.Final] - io.netty:netty-common:[4.1.127.Final] - io.netty:netty-codec:[4.1.127.Final] - io.netty:netty-codec-http:[4.1.127.Final] - io.netty:netty-codec-http2:[4.1.127.Final] - io.netty:netty-handler:[4.1.127.Final] - io.netty:netty-handler-proxy:[4.1.127.Final] - io.netty:netty-transport-native-unix-common:[4.1.127.Final] - io.netty:netty-transport-native-epoll:[4.1.127.Final] - io.netty:netty-transport-native-kqueue:[4.1.127.Final] + io.projectreactor.netty:reactor-netty-http:[1.2.13] + io.netty:netty-buffer:[4.1.130.Final] + io.netty:netty-common:[4.1.130.Final] + io.netty:netty-codec:[4.1.130.Final] + io.netty:netty-codec-http:[4.1.130.Final] + io.netty:netty-codec-http2:[4.1.130.Final] + io.netty:netty-handler:[4.1.130.Final] + io.netty:netty-handler-proxy:[4.1.130.Final] + io.netty:netty-transport-native-unix-common:[4.1.130.Final] + io.netty:netty-transport-native-epoll:[4.1.130.Final] + io.netty:netty-transport-native-kqueue:[4.1.130.Final] diff --git a/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/NettyAsyncHttpClientBuilder.java b/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/NettyAsyncHttpClientBuilder.java index 2c9ba2e8e9e9..1ee286d12e3a 100644 --- a/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/NettyAsyncHttpClientBuilder.java +++ b/sdk/core/azure-core-http-netty/src/main/java/com/azure/core/http/netty/NettyAsyncHttpClientBuilder.java @@ -216,9 +216,9 @@ public com.azure.core.http.HttpClient build() { // .httpResponseDecoder passes a new HttpResponseDecoderSpec and any existing configuration should be updated // instead of overwritten. HttpResponseDecoderSpec initialSpec = nettyHttpClient.configuration().decoder(); + long connectTimeoutMillis = getTimeout(connectTimeout, getDefaultConnectTimeout()).toMillis(); nettyHttpClient = nettyHttpClient.port(port) - .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, - (int) getTimeout(connectTimeout, getDefaultConnectTimeout()).toMillis()) + .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, (int) connectTimeoutMillis) .httpResponseDecoder(httpResponseDecoderSpec -> { int maxHeaderSize = initialSpec.maxHeaderSize(); if (maxHeaderSize == HttpDecoderSpec.DEFAULT_MAX_HEADER_SIZE) { @@ -266,16 +266,18 @@ public com.azure.core.http.HttpClient build() { addProxyHandler = true; nettyHttpClient = nettyHttpClient.doOnChannelInit((connectionObserver, channel, socketAddress) -> { if (shouldApplyProxy(socketAddress, nonProxyHostsPattern)) { - channel.pipeline() - .addFirst(NettyPipeline.ProxyHandler, - new HttpProxyHandler(AddressUtils.replaceWithResolved(buildProxyOptions.getAddress()), - handler, proxyChallengeHolder)); + HttpProxyHandler httpProxyHandler + = new HttpProxyHandler(AddressUtils.replaceWithResolved(buildProxyOptions.getAddress()), + handler, proxyChallengeHolder); + httpProxyHandler.setConnectTimeoutMillis(connectTimeoutMillis); + channel.pipeline().addFirst(NettyPipeline.ProxyHandler, httpProxyHandler); } }); } else { nettyHttpClient = nettyHttpClient.proxy(proxy -> proxy.type(toReactorNettyProxyType(buildProxyOptions.getType())) .socketAddress(buildProxyOptions.getAddress()) + .connectTimeoutMillis(connectTimeoutMillis) .username(buildProxyOptions.getUsername()) .password(ignored -> buildProxyOptions.getPassword()) .nonProxyHosts(buildProxyOptions.getNonProxyHosts())); diff --git a/sdk/core/azure-core-http-vertx/CHANGELOG.md b/sdk/core/azure-core-http-vertx/CHANGELOG.md index 28583d856ec7..dc0bbdfb0f27 100644 --- a/sdk/core/azure-core-http-vertx/CHANGELOG.md +++ b/sdk/core/azure-core-http-vertx/CHANGELOG.md @@ -10,6 +10,11 @@ ### Other Changes +#### Dependency Updates + +- Upgraded `vertx-codegen` from `4.5.17` to `4.5.23`. +- Upgraded `vertx-core` from `4.5.17` to `4.5.23`. + ## 1.1.2 (2025-10-06) ### Other Changes diff --git a/sdk/core/azure-core-http-vertx/pom.xml b/sdk/core/azure-core-http-vertx/pom.xml index c907b096e765..054f602bc874 100644 --- a/sdk/core/azure-core-http-vertx/pom.xml +++ b/sdk/core/azure-core-http-vertx/pom.xml @@ -82,14 +82,14 @@ io.vertx vertx-codegen - 4.5.17 + 4.5.23 provided io.vertx vertx-core - 4.5.17 + 4.5.23 @@ -172,8 +172,8 @@ - io.vertx:vertx-codegen:[4.5.17] - io.vertx:vertx-core:[4.5.17] + io.vertx:vertx-codegen:[4.5.23] + io.vertx:vertx-core:[4.5.23] diff --git a/sdk/core/azure-core-version-tests/pom.xml b/sdk/core/azure-core-version-tests/pom.xml index 9523d94d1e4f..c5a411966a46 100644 --- a/sdk/core/azure-core-version-tests/pom.xml +++ b/sdk/core/azure-core-version-tests/pom.xml @@ -95,7 +95,7 @@ io.projectreactor reactor-core - 3.7.11 + 3.7.14 + io.projectreactor:reactor-core:[3.7.14] com.fasterxml.jackson.core:jackson-annotations:[2.18.4] com.fasterxml.jackson.core:jackson-core:[2.18.4.1] com.fasterxml.jackson.core:jackson-databind:[2.18.4] diff --git a/sdk/core/azure-core/pom.xml b/sdk/core/azure-core/pom.xml index 50bcda060b2e..35b5d61b2f9a 100644 --- a/sdk/core/azure-core/pom.xml +++ b/sdk/core/azure-core/pom.xml @@ -146,7 +146,7 @@ io.projectreactor reactor-core - 3.7.11 + 3.7.14 @@ -223,7 +223,7 @@ - io.projectreactor:reactor-core:[3.7.11] + io.projectreactor:reactor-core:[3.7.14] com.fasterxml.jackson.core:jackson-annotations:[2.18.4] com.fasterxml.jackson.core:jackson-core:[2.18.4.1] com.fasterxml.jackson.core:jackson-databind:[2.18.4] diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/CHANGELOG.md b/sdk/cosmos/azure-cosmos-kafka-connect/CHANGELOG.md index 40d044cf49ec..c0b94149aec9 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos-kafka-connect/CHANGELOG.md @@ -7,6 +7,7 @@ #### Breaking Changes #### Bugs Fixed +* Added filtering to deserialization of `"azure.cosmos.client.metadata.caches.snapshot"` - See [PR 47594](https://github.com/Azure/azure-sdk-for-java/pull/47594) #### Other Changes diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosUtils.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosUtils.java index 6009821ea188..6246b9a4566c 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosUtils.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/main/java/com/azure/cosmos/kafka/connect/implementation/KafkaCosmosUtils.java @@ -12,19 +12,37 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.io.InvalidClassException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.io.ObjectStreamClass; import java.util.Base64; +import java.util.HashSet; +import java.util.Set; public class KafkaCosmosUtils { private static final Logger LOGGER = LoggerFactory.getLogger(KafkaCosmosUtils.class); + private static final Set ALLOWED_CLASSES = new HashSet<>(); + static { + ALLOWED_CLASSES.add(CosmosClientMetadataCachesSnapshot.class.getName()); + ALLOWED_CLASSES.add(byte[].class.getName()); + } public static CosmosClientMetadataCachesSnapshot getCosmosClientMetadataFromString(String metadataCacheString) { if (StringUtils.isNotEmpty(metadataCacheString)) { byte[] inputByteArray = Base64.getDecoder().decode(metadataCacheString); try (ObjectInputStream objectInputStream = - new ObjectInputStream(new ByteArrayInputStream(inputByteArray))) { - + new ObjectInputStream(new ByteArrayInputStream(inputByteArray)) { + @Override + protected Class resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { + // Whitelist only allowed classes to prevent rce from arbitrary classes + if (!ALLOWED_CLASSES.contains(desc.getName())) { + LOGGER.error("Invalid class type for deserialization {}", desc.getName()); + throw new InvalidClassException("Unauthorized deserialization attempt", desc.getName()); + } + return super.resolveClass(desc); + } + }) { return (CosmosClientMetadataCachesSnapshot) objectInputStream.readObject(); } catch (IOException | ClassNotFoundException e) { LOGGER.warn("Failed to deserialize cosmos client metadata cache snapshot"); diff --git a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorTest.java b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorTest.java index 5782819f79a5..e4488339a55c 100644 --- a/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorTest.java +++ b/sdk/cosmos/azure-cosmos-kafka-connect/src/test/java/com/azure/cosmos/kafka/connect/CosmosSinkConnectorTest.java @@ -29,14 +29,21 @@ import org.testng.annotations.Test; import reactor.core.publisher.Mono; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; +import java.util.Base64; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; import static org.assertj.core.api.AssertionsForClassTypes.assertThat; @@ -214,6 +221,23 @@ public void taskConfigsForClientMetadataCachesSnapshot() { } } + @Test(groups = "unit") + public void evilDeserializationIsBlocked() throws Exception { + AtomicReference payload = new AtomicReference<>("Test RCE payload"); + Evil evil = new Evil(payload); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (ObjectOutputStream oos = new ObjectOutputStream(baos)) { + oos.writeObject(evil); + } + String evilBase64 = Base64.getEncoder().encodeToString(baos.toByteArray()); + + // Through KafkaCosmosUtils: should be blocked and return null + CosmosClientMetadataCachesSnapshot snapshot = + KafkaCosmosUtils.getCosmosClientMetadataFromString(evilBase64); + assertThat(snapshot).isNull(); + assertThat(payload.get()).isEqualTo("Test RCE payload"); + } + @Test(groups = "unit") public void misFormattedConfig() { CosmosSinkConnector sinkConnector = new CosmosSinkConnector(); @@ -471,4 +495,26 @@ public static class SinkConfigs { true) ); } + + public static class Evil implements Serializable { + private static final long serialVersionUID = 1L; + + private final AtomicReference payload; + + public Evil(AtomicReference payload) { + this.payload = payload; + } + + private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { + in.defaultReadObject(); + System.out.println("Payload executed"); + payload.set("Payload executed"); + } + + @Override + public String toString() { + return "Evil{payload='" + payload.get() + "'}"; + } + } + } diff --git a/sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/pom.xml b/sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/pom.xml index 5f8aa27d8f28..c594cbfb2f1f 100644 --- a/sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark-account-data-resolver-sample/pom.xml @@ -103,7 +103,7 @@ org.scala-lang.modules scala-java8-compat_2.12 - 0.8.0 + 0.9.1 io.projectreactor @@ -281,7 +281,7 @@ org.apache.spark:spark-sql_2.12:[3.5.0] commons-io:commons-io:[2.4] org.scala-lang:scala-library:[2.12.19] - org.scala-lang.modules:scala-java8-compat_2.12:[0.8.0] + org.scala-lang.modules:scala-java8-compat_2.12:[0.9.1] io.projectreactor:reactor-scala-extensions_2.12:[0.8.0] org.scalatest:scalatest_2.12:[3.2.2] org.apache.maven.plugins:maven-antrun-plugin:[3.1.0] diff --git a/sdk/cosmos/azure-cosmos-spark_3-5/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-5/pom.xml index 348d8c15caec..85337b09b220 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-5/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-5/pom.xml @@ -24,6 +24,10 @@ ${cosmos.spark.skip} ${cosmos.spark.skip} 3.5 + 2.12 + 3.5.0 + 3.5.0 + 2.18.4 @@ -93,8 +97,8 @@ org.apache.spark - spark-sql_2.12 - 3.5.0 + spark-sql_${scala.binary.version} + ${spark35.version} io.netty @@ -109,8 +113,8 @@ org.apache.spark - spark-hive_2.12 - 3.5.0 + spark-hive_${scala.binary.version} + ${spark-hive-version} io.netty @@ -130,8 +134,8 @@ com.fasterxml.jackson.module - jackson-module-scala_2.12 - 2.18.4 + jackson-module-scala_${scala.binary.version} + ${scala-jackson.version} diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-12/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-5_2-12/pom.xml index 22434193aeae..5bbe86d16d50 100644 --- a/sdk/cosmos/azure-cosmos-spark_3-5_2-12/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-12/pom.xml @@ -40,6 +40,18 @@ false + 2.12 + 2.12.19 + 3.3.0 + 3.4.0 + 3.5.0 + 0.9.1 + 0.8.0 + 3.2.2 + 3.2.3 + 3.2.3 + 5.0.0 + 2.18.4 @@ -102,13 +114,13 @@ - spark-e2e_3-5 + spark-e2e_3-5_2-12 ${basedir}/scalastyle_config.xml - spark-e2e_3-5 + spark-e2e_3-5_2-12 @@ -148,6 +160,7 @@ scalatest-maven-plugin 2.1.0 + ${scalatest.argLine} ${project.build.directory}/surefire-reports . SparkTestSuite.txt @@ -165,5 +178,14 @@ + + java9-plus + + [9,) + + + --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.cs=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED -Djdk.reflect.useDirectMethodHandle=false + + diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-13/CHANGELOG.md b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/CHANGELOG.md new file mode 100644 index 000000000000..6ae4d7ce01d5 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/CHANGELOG.md @@ -0,0 +1,13 @@ +## Release History + +### 4.43.0-beta.1 (Unreleased) + +#### Features Added + +#### Breaking Changes + +#### Bugs Fixed + +#### Other Changes + +### NOTE: See CHANGELOG.md in 3.3; 3.4 and 3.5 for scala 2.12 projects for changes prior to 4.43.0 diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-13/CONTRIBUTING.md b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/CONTRIBUTING.md new file mode 100644 index 000000000000..6949e20fb69d --- /dev/null +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/CONTRIBUTING.md @@ -0,0 +1,84 @@ +# Contributing +This instruction is guideline for building and code contribution. + +## Prerequisites +- JDK 8 and above +- [Maven](https://maven.apache.org/) 3.0 and above + +## Build from source +To build the project, run maven commands. + +```bash +git clone https://github.com/Azure/azure-sdk-for-java.git +cd sdk/cosmos/azure-cosmos-spark_3-5_2-13 +mvn clean install +``` + +## Test +There are integration tests on azure and on emulator to trigger integration test execution +against Azure Cosmos DB and against +[Azure Cosmos DB Emulator](https://docs.microsoft.com/azure/cosmos-db/local-emulator), you need to +follow the link to set up emulator before test execution. + +- Run unit tests +```bash +mvn clean install -Dgpg.skip +``` + +- Run integration tests + - on Azure + > **NOTE** Please note that integration test against Azure requires Azure Cosmos DB Document + API and will automatically create a Cosmos database in your Azure subscription, then there + will be **Azure usage fee.** + + Integration tests will require a Azure Subscription. If you don't already have an Azure + subscription, you can activate your + [MSDN subscriber benefits](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/) + or sign up for a [free Azure account](https://azure.microsoft.com/free/). + + 1. Create an Azure Cosmos DB on Azure. + - Go to [Azure portal](https://portal.azure.com/) and click +New. + - Click Databases, and then click Azure Cosmos DB to create your database. + - Navigate to the database you have created, and click Access keys and copy your + URI and access keys for your database. + + 2. Set environment variables ACCOUNT_HOST, ACCOUNT_KEY and SECONDARY_ACCOUNT_KEY, where value + of them are Cosmos account URI, primary key and secondary key. + + So set the + second group environment variables NEW_ACCOUNT_HOST, NEW_ACCOUNT_KEY and + NEW_SECONDARY_ACCOUNT_KEY, the two group environment variables can be same. + 3. Run maven command with `integration-test-azure` profile. + + ```bash + set ACCOUNT_HOST=your-cosmos-account-uri + set ACCOUNT_KEY=your-cosmos-account-primary-key + set SECONDARY_ACCOUNT_KEY=your-cosmos-account-secondary-key + + set NEW_ACCOUNT_HOST=your-cosmos-account-uri + set NEW_ACCOUNT_KEY=your-cosmos-account-primary-key + set NEW_SECONDARY_ACCOUNT_KEY=your-cosmos-account-secondary-key + mvnw -P integration-test-azure clean install + ``` + + - on Emulator + + Setup Azure Cosmos DB Emulator by following + [this instruction](https://docs.microsoft.com/azure/cosmos-db/local-emulator), and set + associated environment variables. Then run test with: + ```bash + mvnw -P integration-test-emulator install + ``` + + +- Skip tests execution +```bash +mvn clean install -Dgpg.skip -DskipTests +``` + +## Version management +Developing version naming convention is like `0.1.2-beta.1`. Release version naming convention is like `0.1.2`. + +## Contribute to code +Contribution is welcome. Please follow +[this instruction](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md) to contribute code. diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-13/README.md b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/README.md new file mode 100644 index 000000000000..250fba8bb05e --- /dev/null +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/README.md @@ -0,0 +1,192 @@ +# Azure Cosmos DB OLTP Spark 3 connector + +## Azure Cosmos DB OLTP Spark 3 connector for Spark 3.5 +**Azure Cosmos DB OLTP Spark connector** provides Apache Spark support for Azure Cosmos DB using +the [SQL API][sql_api_query]. +[Azure Cosmos DB][cosmos_introduction] is a globally-distributed database service which allows +developers to work with data using a variety of standard APIs, such as SQL, MongoDB, Cassandra, Graph, and Table. + +If you have any feedback or ideas on how to improve your experience please let us know here: +https://github.com/Azure/azure-sdk-for-java/issues/new + +### Documentation + +- [Getting started](https://aka.ms/azure-cosmos-spark-3-quickstart) +- [Catalog API](https://aka.ms/azure-cosmos-spark-3-catalog-api) +- [Configuration Parameter Reference](https://aka.ms/azure-cosmos-spark-3-config) + +[//]: # (//TODO: add more sections) +[//]: # (//TODO: Enable Client Logging) +[//]: # (//TODO: Examples) +[//]: # (//TODO: Next steps) +[//]: # (//TODO: Key concepts) +[//]: # (//TODO: Azure Cosmos DB Partition) +[//]: # (//TODO: Troubleshooting) + +### Version Compatibility + +#### azure-cosmos-spark_3-5_2-12 +| Connector | Supported Spark Versions | Minimum Java Version | Supported Scala Versions | Supported Databricks Runtimes | Supported Fabric Runtimes | +|-----------|--------------------------|-----------------------|---------------------------|-------------------------------|---------------------------| +| 4.41.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\*, 16.4 LTS | 1.3.\* | +| 4.40.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.39.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.38.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.37.2 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.37.1 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.37.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.36.1 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.36.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.35.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.34.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.33.1 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.33.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.32.1 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.32.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.31.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.30.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | +| 4.29.0 | 3.5.0 | [8, 11] | 2.12 | 14.\*, 15.\* | | + +Note: Java 8 prior to version 8u371 support is deprecated as of Spark 3.5.0. When using the Scala API, it is necessary for applications +to use the same version of Scala that Spark was compiled for. + +#### azure-cosmos-spark_3-4_2-12 +| Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | Supported Fabric Runtimes | +|-----------|--------------------------|------------------------|--------------------------|-------------------------------|---------------------------| +| 4.41.0 | 3.4.0 - 3.4.1 | [8, 11] | 2.12 | 13.\* | | +| 4.40.0 | 3.4.0 - 3.4.1 | [8, 11] | 2.12 | 13.\* | | +| 4.39.0 | 3.4.0 - 3.4.1 | [8, 11] | 2.12 | 13.\* | | +| 4.38.0 | 3.4.0 - 3.4.1 | [8, 11] | 2.12 | 13.\* | | +| 4.37.2 | 3.4.0 - 3.4.1 | [8, 11] | 2.12 | 13.\* | | +| 4.37.1 | 3.4.0 - 3.4.1 | [8, 11] | 2.12 | 13.\* | | +| 4.37.0 | 3.4.0 - 3.4.1 | [8, 11] | 2.12 | 13.\* | | +| 4.36.1 | 3.4.0 - 3.4.1 | [8, 11] | 2.12 | 13.\* | | +| 4.36.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.35.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.34.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.33.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.33.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.32.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.32.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.31.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.30.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.29.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.28.4 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.28.3 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.28.2 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.28.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.28.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.27.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.27.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.26.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.26.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.25.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.25.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.24.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.24.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.23.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.22.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.21.1 | 3.4.0 | [8, 11] | 2.12 | 13.* | | +| 4.21.0 | 3.4.0 | [8, 11] | 2.12 | 13.* | | + +#### azure-cosmos-spark_3-3_2-12 +| Connector | Supported Spark Versions | Supported JVM Versions | Supported Scala Versions | Supported Databricks Runtimes | +|-----------|--------------------------|------------------------|--------------------------|-------------------------------| +| 4.41.0 | 3.3.0 - 3.3.2 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.40.0 | 3.3.0 - 3.3.2 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.39.0 | 3.3.0 - 3.3.2 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.38.0 | 3.3.0 - 3.3.2 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.37.2 | 3.3.0 - 3.3.2 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.37.1 | 3.3.0 - 3.3.2 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.37.0 | 3.3.0 - 3.3.2 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.36.1 | 3.3.0 - 3.3.2 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.36.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.35.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.34.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.33.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.33.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.32.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.32.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.31.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.30.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.29.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.28.4 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.28.3 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.28.2 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.28.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.28.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.27.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.27.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.26.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.26.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.25.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.25.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.24.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.24.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.23.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.22.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.21.1 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.21.0 | 3.3.0 | [8, 11] | 2.12 | 11.\*, 12.\* | +| 4.20.0 | 3.3.0 | [8, 11] | 2.12 | 11.\* | +| 4.19.0 | 3.3.0 | [8, 11] | 2.12 | 11.\* | +| 4.18.2 | 3.3.0 | [8, 11] | 2.12 | 11.\* | +| 4.18.1 | 3.3.0 | [8, 11] | 2.12 | 11.\* | +| 4.18.0 | 3.3.0 | [8, 11] | 2.12 | 11.\* | +| 4.17.2 | 3.3.0 | [8, 11] | 2.12 | 11.\* | +| 4.17.0 | 3.3.0 | [8, 11] | 2.12 | 11.\* | +| 4.16.0 | 3.3.0 | [8, 11] | 2.12 | 11.\* | +| 4.15.0 | 3.3.0 | [8, 11] | 2.12 | 11.\* | + +### Download + +You can use the maven coordinate of the jar to auto install the Spark Connector to your Databricks Runtime from Maven: +`com.azure.cosmos.spark:azure-cosmos-spark_3-5_2-12:4.41.0` + +You can also integrate against Cosmos DB Spark Connector in your SBT project: +```scala +libraryDependencies += "com.azure.cosmos.spark" % "azure-cosmos-spark_3-5_2-12" % "4.41.0" +``` + +Cosmos DB Spark Connector is available on [Maven Central Repo](https://central.sonatype.com/search?namespace=com.azure.cosmos.spark). + +#### General + +If you encounter any bug, please file an issue [here](https://github.com/Azure/azure-sdk-for-java/issues/new). + +To suggest a new feature or changes that could be made, file an issue the same way you would for a bug. + +### License +This project is under MIT license and uses and repackages other third party libraries as an uber jar. +See [NOTICE.txt](https://github.com/Azure/azure-sdk-for-java/blob/main/NOTICE.txt). + +### Contributing + +This project welcomes contributions and suggestions. Most contributions require you to agree to a +[Contributor License Agreement (CLA)][cla] declaring that you have the right to, and actually do, grant us the rights +to use your contribution. + +When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate +the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to +do this once across all repos using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For more information see the [Code of Conduct FAQ][coc_faq] +or contact [opencode@microsoft.com][coc_contact] with any additional questions or comments. + + +[source_code]: src +[cosmos_introduction]: https://learn.microsoft.com/azure/cosmos-db/ +[cosmos_docs]: https://learn.microsoft.com/azure/cosmos-db/introduction +[jdk]: https://learn.microsoft.com/java/azure/jdk/?view=azure-java-stable +[maven]: https://maven.apache.org/ +[cla]: https://cla.microsoft.com +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ +[coc_contact]: mailto:opencode@microsoft.com +[azure_subscription]: https://azure.microsoft.com/free/ +[samples]: https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/spring/azure-spring-data-cosmos/src/samples/java/com/azure/spring/data/cosmos +[sql_api_query]: https://learn.microsoft.com/azure/cosmos-db/sql-api-sql-query +[local_emulator]: https://learn.microsoft.com/azure/cosmos-db/local-emulator +[local_emulator_export_ssl_certificates]: https://learn.microsoft.com/azure/cosmos-db/local-emulator-export-ssl-certificates +[azure_cosmos_db_partition]: https://learn.microsoft.com/azure/cosmos-db/partition-data +[sql_queries_in_cosmos]: https://learn.microsoft.com/azure/cosmos-db/tutorial-query-sql-api +[sql_queries_getting_started]: https://learn.microsoft.com/azure/cosmos-db/sql-query-getting-started diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-13/pom.xml b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/pom.xml new file mode 100644 index 000000000000..c91292394edc --- /dev/null +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/pom.xml @@ -0,0 +1,171 @@ + + + 4.0.0 + + com.azure.cosmos.spark + azure-cosmos-spark_3-5 + 0.0.1-beta.1 + ../azure-cosmos-spark_3-5 + + com.azure.cosmos.spark + azure-cosmos-spark_3-5_2-13 + 4.43.0-beta.1 + jar + https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/cosmos/azure-cosmos-spark_3-5_2-13 + OLTP Spark 3.5 Connector for Azure Cosmos DB SQL API + OLTP Spark 3.5 Connector for Azure Cosmos DB SQL API + + scm:git:https://github.com/Azure/azure-sdk-for-java.git/sdk/cosmos/azure-cosmos-spark_3-5_2-13 + + https://github.com/Azure/azure-sdk-for-java/sdk/cosmos/azure-cosmos-spark_3-5_2-13 + + + Microsoft Corporation + http://microsoft.com + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + microsoft + Microsoft Corporation + + + + false + 2.13 + 2.13.17 + 0.9.1 + 0.8.0 + 3.2.2 + 3.2.3 + 3.2.3 + 5.0.0 + + + + + org.codehaus.mojo + build-helper-maven-plugin + 3.6.1 + + + add-sources + generate-sources + + add-source + + + + ${basedir}/../azure-cosmos-spark_3/src/main/scala + ${basedir}/../azure-cosmos-spark_3-5/src/main/scala + ${basedir}/src/main/scala + + + + + add-test-sources + generate-test-sources + + add-test-source + + + + ${basedir}/../azure-cosmos-spark_3/src/test/scala + ${basedir}/../azure-cosmos-spark_3-5/src/test/scala + ${basedir}/src/test/scala + + + + + add-resources + generate-resources + + add-resource + + + + ${basedir}/../azure-cosmos-spark_3/src/main/resources + ${basedir}/../azure-cosmos-spark_3-5/src/main/resources + ${basedir}/src/main/resources + + + + + + + org.apache.maven.plugins + maven-enforcer-plugin + 3.6.1 + + + + + + + spark-e2e_3-5_2-13 + + + ${basedir}/scalastyle_config.xml + + + spark-e2e_3-5_2-13 + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.3 + + + **/*.* + **/*Test.* + **/*Suite.* + **/*Spec.* + + true + + + + org.scalatest + scalatest-maven-plugin + 2.1.0 + + ${scalatest.argLine} + ${project.build.directory}/surefire-reports + . + SparkTestSuite.txt + (ITest|Test|Spec|Suite) + + + + test + + test + + + + + + + + + java9-plus + + [9,) + + + --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.nio.cs=ALL-UNNAMED --add-opens=java.base/sun.security.action=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.security.jgss/sun.security.krb5=ALL-UNNAMED -Djdk.reflect.useDirectMethodHandle=false + + + + diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-13/scalastyle_config.xml b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/scalastyle_config.xml new file mode 100644 index 000000000000..7a8ad2823fb8 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/scalastyle_config.xml @@ -0,0 +1,130 @@ + + Scalastyle standard configuration + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/main/resources/azure-cosmos-spark.properties b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/main/resources/azure-cosmos-spark.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/main/resources/azure-cosmos-spark.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/test/resources/META-INF/services/com.azure.cosmos.spark.CosmosClientBuilderInterceptor b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/test/resources/META-INF/services/com.azure.cosmos.spark.CosmosClientBuilderInterceptor new file mode 100644 index 000000000000..0d43a5bfc657 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/test/resources/META-INF/services/com.azure.cosmos.spark.CosmosClientBuilderInterceptor @@ -0,0 +1 @@ +com.azure.cosmos.spark.TestCosmosClientBuilderInterceptor \ No newline at end of file diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/test/resources/META-INF/services/com.azure.cosmos.spark.CosmosClientInterceptor b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/test/resources/META-INF/services/com.azure.cosmos.spark.CosmosClientInterceptor new file mode 100644 index 000000000000..e2239720776d --- /dev/null +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/test/resources/META-INF/services/com.azure.cosmos.spark.CosmosClientInterceptor @@ -0,0 +1 @@ +com.azure.cosmos.spark.TestFaultInjectionClientInterceptor \ No newline at end of file diff --git a/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/test/resources/META-INF/services/com.azure.cosmos.spark.WriteOnRetryCommitInterceptor b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/test/resources/META-INF/services/com.azure.cosmos.spark.WriteOnRetryCommitInterceptor new file mode 100644 index 000000000000..c60cbf2f14e4 --- /dev/null +++ b/sdk/cosmos/azure-cosmos-spark_3-5_2-13/src/test/resources/META-INF/services/com.azure.cosmos.spark.WriteOnRetryCommitInterceptor @@ -0,0 +1 @@ +com.azure.cosmos.spark.TestWriteOnRetryCommitInterceptor \ No newline at end of file diff --git a/sdk/cosmos/azure-cosmos-spark_3/dev/README.md b/sdk/cosmos/azure-cosmos-spark_3/dev/README.md index d15bf4113612..30ba9fbfc0db 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/dev/README.md +++ b/sdk/cosmos/azure-cosmos-spark_3/dev/README.md @@ -46,6 +46,7 @@ mvn -e -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcodesnippet.skip=true mvn -e -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcodesnippet.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -pl ,azure-cosmos-spark_3-3_2-12 clean install mvn -e -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcodesnippet.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -pl ,azure-cosmos-spark_3-4_2-12 clean install mvn -e -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcodesnippet.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -pl ,azure-cosmos-spark_3-5_2-12 clean install +mvn -e -DskipTests -Dgpg.skip -Dmaven.javadoc.skip=true -Dcodesnippet.skip=true -Dspotbugs.skip=true -Dcheckstyle.skip=true -Drevapi.skip=true -pl ,azure-cosmos-spark_3-5_2-13 clean install ``` Take these files: diff --git a/sdk/cosmos/azure-cosmos-spark_3/pom.xml b/sdk/cosmos/azure-cosmos-spark_3/pom.xml index e7b846207ee5..3dc770578e67 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/pom.xml +++ b/sdk/cosmos/azure-cosmos-spark_3/pom.xml @@ -38,7 +38,20 @@ ${cosmos.spark.skip} ${cosmos.spark.skip} - 3.1 + 3.3 + + 2.12 + 2.12.19 + 3.3.0 + 3.4.0 + 3.5.0 + 0.9.1 + 0.8.0 + 3.2.2 + 3.2.3 + 3.2.3 + 5.0.0 + 2.18.4 @@ -52,7 +65,7 @@ org.scala-lang scala-library - 2.12.19 + ${scala.version} provided @@ -72,13 +85,13 @@ org.scala-lang.modules - scala-java8-compat_2.12 - 0.8.0 + scala-java8-compat_${scala.binary.version} + ${scala-java8-compat.version} io.projectreactor - reactor-scala-extensions_2.12 - 0.8.0 + reactor-scala-extensions_${scala.binary.version} + ${reactor-scala-extensions.version} io.projectreactor @@ -170,26 +183,26 @@ org.scalatest - scalatest_2.12 - 3.2.2 + scalatest_${scala.binary.version} + ${scalatest.version} test org.scalatest - scalatest-flatspec_2.12 - 3.2.3 + scalatest-flatspec_${scala.binary.version} + ${scalatest-flatspec.version} test org.scalactic - scalactic_2.12 - 3.2.3 + scalactic_${scala.binary.version} + ${scalactic.version} test org.scalamock - scalamock_2.12 - 5.0.0 + scalamock_${scala.binary.version} + ${scalamock.version} test @@ -279,20 +292,25 @@ org.apache.commons:commons-lang3:[3.18.0] org.slf4j:slf4j-api:[1.7.36] - org.apache.spark:spark-sql_2.12:[3.3.0] - org.apache.spark:spark-sql_2.12:[3.4.0] - org.apache.spark:spark-sql_2.12:[3.5.0] - org.scala-lang:scala-library:[2.12.19] - org.scala-lang.modules:scala-java8-compat_2.12:[0.8.0] - io.projectreactor:reactor-scala-extensions_2.12:[0.8.0] - org.scalatest:scalatest_2.12:[3.2.2] + org.apache.spark:spark-sql_2.12:[${spark33.version}] + org.apache.spark:spark-sql_2.12:[${spark34.version}] + org.apache.spark:spark-sql_2.12:[${spark35.version}] + org.apache.spark:spark-sql_2.13:[${spark35.version}] + org.scala-lang:scala-library:[${scala.version}] + org.scala-lang.modules:scala-java8-compat_2.12:[${scala-java8-compat.version}] + org.scala-lang.modules:scala-java8-compat_2.13:[${scala-java8-compat.version}] + io.projectreactor:reactor-scala-extensions_2.12:[${reactor-scala-extensions.version}] + io.projectreactor:reactor-scala-extensions_2.13:[${reactor-scala-extensions.version}] + org.scalatest:scalatest_2.12:[${scalatest.version}] + org.scalatest:scalatest_2.13:[${scalatest.version}] org.apache.maven.plugins:maven-antrun-plugin:[3.1.0] net.alchim31.maven:scala-maven-plugin:[4.8.1] org.scalastyle:scalastyle-maven-plugin:[1.0.0] com.fasterxml.jackson.core:jackson-databind:[2.18.4] com.fasterxml.jackson.datatype:jackson-datatype-jsr310:[2.18.4] com.fasterxml.jackson.module:jackson-module-afterburner:[2.18.4] - com.fasterxml.jackson.module:jackson-module-scala_2.12:[2.18.4] + com.fasterxml.jackson.module:jackson-module-scala_2.12:[${scala-jackson.version}] + com.fasterxml.jackson.module:jackson-module-scala_2.13:[${scala-jackson.version}] io.micrometer:micrometer-registry-azure-monitor:[1.15.1] io.micrometer:micrometer-core:[1.15.1] com.microsoft.azure:applicationinsights-core:[2.6.4] @@ -381,7 +399,7 @@ 1.8 1.8 - 2.12.19 + ${scala.version} diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosCatalogBase.scala b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosCatalogBase.scala index 27a69b012eef..3da6ea1cb0b9 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosCatalogBase.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosCatalogBase.scala @@ -604,7 +604,7 @@ class CosmosCatalogBase v.viewName.equals(viewName)) match { case Some(existingView) => val updatedViewDefinitionsSnapshot: Array[ViewDefinition] = - (ArrayBuffer(viewDefinitions: _*) - existingView).toArray + ArrayBuffer(viewDefinitions: _*).filterNot(_ == existingView).toArray if (viewRepositorySnapshot.add( lastBatchId + 1, diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosClientMetrics.scala b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosClientMetrics.scala index 99f906ff4a2e..05defc0884ed 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosClientMetrics.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosClientMetrics.scala @@ -80,7 +80,7 @@ private[spark] object CosmosClientMetrics extends BasicLoggingTrait { override protected def nullGaugeValue: java.lang.Double = Double.NaN - override protected def close(): Unit = { + override def close(): Unit = { super.close() slf4JReporter match { diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosItemIdentityHelper.scala b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosItemIdentityHelper.scala index bc149f9623c8..c91b732d7b63 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosItemIdentityHelper.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosItemIdentityHelper.scala @@ -6,6 +6,7 @@ package com.azure.cosmos.spark import com.azure.cosmos.implementation.routing.PartitionKeyInternal import com.azure.cosmos.implementation.{ImplementationBridgeHelpers, Utils} import com.azure.cosmos.models.{CosmosItemIdentity, PartitionKey} +import com.azure.cosmos.spark.diagnostics.BasicLoggingTrait import java.util @@ -13,7 +14,7 @@ import java.util import scala.collection.JavaConverters._ // scalastyle:on underscore.import -private[spark] object CosmosItemIdentityHelper { +private[spark] object CosmosItemIdentityHelper extends BasicLoggingTrait { // pattern will be recognized // 1. id(idValue).pk(partitionKeyValue) // diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosTableSchemaInferrer.scala b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosTableSchemaInferrer.scala index 41af8d70cef9..0b7d46dae134 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosTableSchemaInferrer.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/CosmosTableSchemaInferrer.scala @@ -163,7 +163,7 @@ private object CosmosTableSchemaInferrer .limit(cosmosInferenceConfig.inferSchemaSamplingSize) .collect(Collectors.toList[ObjectNode]()) - schema = Some(inferSchema(feedResponseList.asScala, + schema = Some(inferSchema(feedResponseList.asScala.toSeq, cosmosInferenceConfig.inferSchemaQuery.isDefined || cosmosInferenceConfig.includeSystemProperties, cosmosInferenceConfig.inferSchemaQuery.isDefined || cosmosInferenceConfig.includeTimestamp, cosmosInferenceConfig.allowNullForInferredProperties)) diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/PointWriter.scala b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/PointWriter.scala index 45d45e033e53..8f07bf5339d5 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/PointWriter.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/PointWriter.scala @@ -145,7 +145,7 @@ private class PointWriter(container: CosmosAsyncContainer, executeAsync(() => createWithRetry(partitionKeyValue, objectNode, createOperation)) .onComplete { case Success(_) => - promise.success(Unit) + promise.success(()) pendingPointWrites.remove(promise.future) log.logItemWriteCompletion(createOperation) case Failure(e) => @@ -167,7 +167,7 @@ private class PointWriter(container: CosmosAsyncContainer, executeAsync(() => upsertWithRetry(partitionKeyValue, objectNode, upsertOperation)) .onComplete { case Success(_) => - promise.success(Unit) + promise.success(()) pendingPointWrites.remove(promise.future) log.logItemWriteCompletion(upsertOperation) case Failure(e) => @@ -191,7 +191,7 @@ private class PointWriter(container: CosmosAsyncContainer, executeAsync(() => deleteWithRetry(partitionKeyValue, objectNode, onlyIfNotModified, deleteOperation)) .onComplete { case Success(_) => - promise.success(Unit) + promise.success(()) pendingPointWrites.remove(promise.future) log.logItemWriteCompletion(deleteOperation) case Failure(e) => @@ -214,7 +214,7 @@ private class PointWriter(container: CosmosAsyncContainer, executeAsync(() => patchWithRetry(partitionKeyValue, objectNode, patchOperation, ignoreNotFound)) .onComplete { case Success(_) => - promise.success(Unit) + promise.success(()) pendingPointWrites.remove(promise.future) log.logItemWriteCompletion(patchOperation) case Failure(e) => @@ -241,7 +241,7 @@ private class PointWriter(container: CosmosAsyncContainer, executeAsync(() => replaceIfNotModifiedWithRetry(partitionKeyValue, objectNode, etag, replaceOperation)) .onComplete { case Success(_) => - promise.success(Unit) + promise.success(()) pendingPointWrites.remove(promise.future) log.logItemWriteCompletion(replaceOperation) case Failure(e) => @@ -648,7 +648,7 @@ private class PointWriter(container: CosmosAsyncContainer, override def call(): Unit = { try { work() - future.complete(Unit) + future.complete(()) } catch { case e: Exception => future.completeExceptionally(e) diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/TransientIOErrorsRetryingReadManyIterator.scala b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/TransientIOErrorsRetryingReadManyIterator.scala index 39053c668574..c51c5c1226e1 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/TransientIOErrorsRetryingReadManyIterator.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/TransientIOErrorsRetryingReadManyIterator.scala @@ -59,7 +59,7 @@ private[spark] class TransientIOErrorsRetryingReadManyIterator[TSparkRow] while (returnValue.isEmpty) { if (readManyFilterBatchIterator.hasNext) { // fetch items for the next readMany filter batch - val readManyFilterBatch = readManyFilterBatchIterator.next() + val readManyFilterBatch = readManyFilterBatchIterator.next().toList returnValue = TransientErrorsRetryPolicy.executeWithRetry( () => hasNextInternalCore(readManyFilterBatch), diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/catalog/CosmosCatalogCosmosSDKClient.scala b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/catalog/CosmosCatalogCosmosSDKClient.scala index d4e7e07f73f7..0ee2162eabd0 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/catalog/CosmosCatalogCosmosSDKClient.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/catalog/CosmosCatalogCosmosSDKClient.scala @@ -4,7 +4,8 @@ package com.azure.cosmos.spark.catalog import com.azure.cosmos.CosmosAsyncClient -import com.azure.cosmos.models.{CosmosContainerProperties, ExcludedPath, FeedRange, IncludedPath, IndexingMode, IndexingPolicy, ModelBridgeInternal, PartitionKeyDefinition, PartitionKeyDefinitionVersion, PartitionKind, SparkModelBridgeInternal, ThroughputProperties} +import com.azure.cosmos.models.{CosmosContainerProperties => ModelsCosmosContainerProperties, ExcludedPath, FeedRange, IncludedPath, IndexingMode, IndexingPolicy, ModelBridgeInternal, PartitionKeyDefinition, PartitionKeyDefinitionVersion, PartitionKind, SparkModelBridgeInternal, ThroughputProperties} +import com.azure.cosmos.spark.catalog.{CosmosContainerProperties => CatalogCosmosContainerProperties} import com.azure.cosmos.spark.diagnostics.BasicLoggingTrait import com.azure.cosmos.spark.{ContainerFeedRangesCache, CosmosConstants, Exceptions} import org.apache.spark.sql.connector.catalog.{NamespaceChange, TableChange} @@ -21,6 +22,8 @@ import java.util.Collections import scala.collection.JavaConverters._ // scalastyle:on underscore.import + + private[spark] case class CosmosCatalogCosmosSDKClient(cosmosAsyncClient: CosmosAsyncClient) extends CosmosCatalogClient with BasicLoggingTrait { @@ -80,15 +83,15 @@ private[spark] case class CosmosCatalogCosmosSDKClient(cosmosAsyncClient: Cosmos val partitionKeyDefinition = getPartitionKeyDefinition(containerProperties) val indexingPolicy = getIndexingPolicy(containerProperties) - val cosmosContainerProperties = new CosmosContainerProperties(containerName, partitionKeyDefinition) + val cosmosContainerProperties = new ModelsCosmosContainerProperties(containerName, partitionKeyDefinition) cosmosContainerProperties.setIndexingPolicy(indexingPolicy) - CosmosContainerProperties.getDefaultTtlInSeconds(containerProperties) match { + CatalogCosmosContainerProperties.getDefaultTtlInSeconds(containerProperties) match { case Some(ttl) => cosmosContainerProperties.setDefaultTimeToLiveInSeconds(ttl) case None => } - CosmosContainerProperties.getAnalyticalStoreTtlInSeconds(containerProperties) match { + CatalogCosmosContainerProperties.getAnalyticalStoreTtlInSeconds(containerProperties) match { case Some(ttl) => cosmosContainerProperties.setAnalyticalStoreTimeToLiveInSeconds(ttl) case None => } @@ -147,15 +150,15 @@ private[spark] case class CosmosCatalogCosmosSDKClient(cosmosAsyncClient: Cosmos cosmosAsyncClient.getDatabase(databaseName).read().asScala.`then`() private def getIndexingPolicy(containerProperties: Map[String, String]): IndexingPolicy = { - val indexingPolicySpecification = CosmosContainerProperties.getIndexingPolicy(containerProperties) + val indexingPolicySpecification = CatalogCosmosContainerProperties.getIndexingPolicy(containerProperties) //scalastyle:on multiple.string.literals - if (CosmosContainerProperties.AllPropertiesIndexingPolicyName.equalsIgnoreCase(indexingPolicySpecification)) { + if (CatalogCosmosContainerProperties.AllPropertiesIndexingPolicyName.equalsIgnoreCase(indexingPolicySpecification)) { new IndexingPolicy() .setAutomatic(true) .setIndexingMode(IndexingMode.CONSISTENT) .setIncludedPaths(util.Arrays.asList(new IncludedPath("/*"))) .setExcludedPaths(util.Arrays.asList(new ExcludedPath(raw"""/"_etag"/?"""))) - } else if (CosmosContainerProperties.OnlySystemPropertiesIndexingPolicyName.equalsIgnoreCase(indexingPolicySpecification)) { + } else if (CatalogCosmosContainerProperties.OnlySystemPropertiesIndexingPolicyName.equalsIgnoreCase(indexingPolicySpecification)) { new IndexingPolicy() .setAutomatic(true) .setIndexingMode(IndexingMode.CONSISTENT) @@ -168,42 +171,38 @@ private[spark] case class CosmosCatalogCosmosSDKClient(cosmosAsyncClient: Cosmos } private def getPartitionKeyDefinition(containerProperties: Map[String, String]): PartitionKeyDefinition = { - val partitionKeyPath = CosmosContainerProperties.getPartitionKeyPath(containerProperties) + val partitionKeyPath = CatalogCosmosContainerProperties.getPartitionKeyPath(containerProperties) val partitionKeyDef = new PartitionKeyDefinition val paths = new util.ArrayList[String] val pathList = partitionKeyPath.split(",").toList if (pathList.size >= 2) { - partitionKeyDef.setKind(CosmosContainerProperties.getPartitionKeyKind(containerProperties) match { - case Some(pkKind) => { - if (pkKind == PartitionKind.HASH.toString) { - throw new IllegalArgumentException("PartitionKind HASH is not supported for multi-hash partition key") - } - PartitionKind.MULTI_HASH - } + partitionKeyDef.setKind(CatalogCosmosContainerProperties.getPartitionKeyKind(containerProperties) match { + case Some(pkKind) => + if (pkKind == PartitionKind.HASH.toString) { + throw new IllegalArgumentException("PartitionKind HASH is not supported for multi-hash partition key") + } + PartitionKind.MULTI_HASH case None => PartitionKind.MULTI_HASH }) - partitionKeyDef.setVersion(CosmosContainerProperties.getPartitionKeyVersion(containerProperties) match { + partitionKeyDef.setVersion(CatalogCosmosContainerProperties.getPartitionKeyVersion(containerProperties) match { case Some(pkVersion) => - { - if (pkVersion == PartitionKeyDefinitionVersion.V1.toString) { - throw new IllegalArgumentException("PartitionKeyVersion V1 is not supported for multi-hash partition key") - } - PartitionKeyDefinitionVersion.V2 + if (pkVersion == PartitionKeyDefinitionVersion.V1.toString) { + throw new IllegalArgumentException("PartitionKeyVersion V1 is not supported for multi-hash partition key") } + PartitionKeyDefinitionVersion.V2 case None => PartitionKeyDefinitionVersion.V2 }) pathList.foreach(path => paths.add(path.trim)) } else { - partitionKeyDef.setKind(CosmosContainerProperties.getPartitionKeyKind(containerProperties) match { - case Some(pkKind) => { - if (pkKind == PartitionKind.MULTI_HASH.toString) { - throw new IllegalArgumentException("PartitionKind MULTI_HASH is not supported for single-hash partition key") - } - PartitionKind.HASH - } + partitionKeyDef.setKind(CatalogCosmosContainerProperties.getPartitionKeyKind(containerProperties) match { + case Some(pkKind) => + if (pkKind == PartitionKind.MULTI_HASH.toString) { + throw new IllegalArgumentException("PartitionKind MULTI_HASH is not supported for single-hash partition key") + } + PartitionKind.HASH case None => PartitionKind.HASH }) - CosmosContainerProperties.getPartitionKeyVersion(containerProperties) match { + CatalogCosmosContainerProperties.getPartitionKeyVersion(containerProperties) match { case Some(pkVersion) => partitionKeyDef.setVersion(PartitionKeyDefinitionVersion.valueOf(pkVersion)) case None => } @@ -278,10 +277,10 @@ private[spark] case class CosmosCatalogCosmosSDKClient(cosmosAsyncClient: Cosmos // scalastyle:off method.length private def generateTblProperties ( - metadata: (CosmosContainerProperties, List[FeedRange], Option[(ThroughputProperties, Boolean)]) + metadata: (ModelsCosmosContainerProperties, List[FeedRange], Option[(ThroughputProperties, Boolean)]) ): util.HashMap[String, String] = { - val containerProperties: CosmosContainerProperties = metadata._1 + val containerProperties: ModelsCosmosContainerProperties = metadata._1 val feedRanges: List[FeedRange] = metadata._2 val throughputPropertiesOption: Option[(ThroughputProperties, Boolean)] = metadata._3 diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/udf/GetCosmosItemIdentityValue.scala b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/udf/GetCosmosItemIdentityValue.scala index f8c2a7b7dac9..45259f6b6a66 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/udf/GetCosmosItemIdentityValue.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/main/scala/com/azure/cosmos/spark/udf/GetCosmosItemIdentityValue.scala @@ -20,9 +20,9 @@ class GetCosmosItemIdentityValue extends UDF2[String, Object, String] { requireNotNull(partitionKeyValue, "partitionKeyValue") partitionKeyValue match { - // for subpartitions case - case wrappedArray: mutable.WrappedArray[Any] => - CosmosItemIdentityHelper.getCosmosItemIdentityValueString(id, wrappedArray.map(_.asInstanceOf[Object]).toList) + // for subpartitions case - Seq covers both WrappedArray (Scala 2.12) and ArraySeq (Scala 2.13) + case seq: Seq[Any] => + CosmosItemIdentityHelper.getCosmosItemIdentityValueString(id, seq.map(_.asInstanceOf[Object]).toList) case _ => CosmosItemIdentityHelper.getCosmosItemIdentityValueString(id, List(partitionKeyValue)) } } diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/CosmosConfigSpec.scala b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/CosmosConfigSpec.scala index c73bdb027fc4..0144b468582b 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/CosmosConfigSpec.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/CosmosConfigSpec.scala @@ -252,7 +252,7 @@ class CosmosConfigSpec extends UnitSpec with BasicLoggingTrait { case otherError: Throwable => throw otherError } - val userCfgMissingArmEndpoint = userConfig.toMap.filterKeys(_ != "spark.cosmos.account.azureEnvironment.mANagement") + val userCfgMissingArmEndpoint = userConfig.toMap.filter(_._1 != "spark.cosmos.account.azureEnvironment.mANagement") try { CosmosAccountConfig.parseCosmosAccountConfig(userCfgMissingArmEndpoint) throw new IllegalStateException("Should never reach here when ARM endpoint config is missing") diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/CosmosPartitionPlannerITest.scala b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/CosmosPartitionPlannerITest.scala index 78262b17455f..8826c6d46fe4 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/CosmosPartitionPlannerITest.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/CosmosPartitionPlannerITest.scala @@ -20,7 +20,7 @@ import java.util import java.util.UUID import java.util.concurrent.atomic.{AtomicInteger, AtomicLong} import scala.collection.mutable.ArrayBuffer -import scala.jdk.CollectionConverters.asScalaBufferConverter +import scala.jdk.CollectionConverters._ class CosmosPartitionPlannerITest extends UnitSpec @@ -386,7 +386,7 @@ class CosmosPartitionPlannerITest val alwaysThrow = false partitions.foreach { - case _: CosmosInputPartition => Unit + case _: CosmosInputPartition => () case _ => assert(alwaysThrow, "Unexpected partition type") } partitions should have size expectedPartitionCount diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/FilterAnalyzerSpec.scala b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/FilterAnalyzerSpec.scala index 659dd0782399..949384815fb1 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/FilterAnalyzerSpec.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/FilterAnalyzerSpec.scala @@ -53,7 +53,7 @@ class FilterAnalyzerSpec extends UnitSpec { EqualTo("physicist", "Schrodinger"), In("isCatAlive", Array(true, false))) val analyzedQuery = filterProcessorWithoutCustomQuery.analyze(filters) analyzedQuery.filtersNotSupportedByCosmos shouldBe empty - analyzedQuery.filtersToBePushedDownToCosmos.toIterable should contain theSameElementsAs filters.toList + analyzedQuery.filtersToBePushedDownToCosmos.toArray should contain theSameElementsAs filters.toList val query = analyzedQuery.cosmosParametrizedQuery query.queryText shouldEqual "SELECT * FROM r WHERE r['physicist']=@param0 AND r['isCatAlive'] IN (@param1,@param2)" @@ -223,7 +223,7 @@ class FilterAnalyzerSpec extends UnitSpec { EqualTo("physicist", "Schrodinger"), In("isCatAlive", Array(true, false))) val analyzedQuery = filterProcessorWithCustomQuery.analyze(filters) analyzedQuery.filtersToBePushedDownToCosmos shouldBe empty - analyzedQuery.filtersNotSupportedByCosmos.toIterable should contain theSameElementsAs filters.toList + analyzedQuery.filtersNotSupportedByCosmos.toArray should contain theSameElementsAs filters.toList val query = analyzedQuery.cosmosParametrizedQuery query.queryText shouldEqual queryText @@ -238,7 +238,7 @@ class FilterAnalyzerSpec extends UnitSpec { val analyzedFilters = filterProcessorWithoutCustomQuery.analyze(filters) analyzedFilters.filtersToBePushedDownToCosmos shouldBe empty - analyzedFilters.filtersNotSupportedByCosmos.toIterable should contain theSameElementsAs filters.toList + analyzedFilters.filtersNotSupportedByCosmos.toArray should contain theSameElementsAs filters.toList analyzedFilters.cosmosParametrizedQuery.queryText shouldEqual QueryFilterAnalyzer.rootParameterizedQuery.queryText analyzedFilters.readManyFiltersOpt.isDefined shouldBe false } diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/SparkE2EBulkWriteITest.scala b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/SparkE2EBulkWriteITest.scala index 0ad43de74e30..a1be10199ed9 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/SparkE2EBulkWriteITest.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/SparkE2EBulkWriteITest.scala @@ -114,7 +114,7 @@ class SparkE2EBulkWriteITest toBeIngested += s"record_$i" } - val df = toBeIngested.toDF("id") + val df = toBeIngested.toSeq.toDF("id") var bytesWrittenSnapshot = 0L var recordsWrittenSnapshot = 0L diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/SparkE2EChangeFeedITest.scala b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/SparkE2EChangeFeedITest.scala index 6c82a92f59be..85d46a8e4032 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/SparkE2EChangeFeedITest.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/SparkE2EChangeFeedITest.scala @@ -20,7 +20,7 @@ import java.time.Duration import java.util.UUID import scala.collection.mutable import scala.collection.mutable.ArrayBuffer -import scala.jdk.CollectionConverters.asScalaBufferConverter +import scala.jdk.CollectionConverters._ class SparkE2EChangeFeedITest extends IntegrationSpec @@ -248,7 +248,6 @@ class SparkE2EChangeFeedITest val cosmosMasterKey = TestConfigurations.MASTER_KEY CosmosClientMetrics.meterRegistry.isDefined shouldEqual true - val meterRegistry = CosmosClientMetrics.meterRegistry.get val container = cosmosClient.getDatabase(cosmosDatabase).getContainer(cosmosContainer) val sinkContainerName = cosmosClient @@ -535,8 +534,10 @@ class SparkE2EChangeFeedITest val collectedFrame = groupedFrame.collect() collectedFrame.foreach(row => { - val wrappedArray = row.get(1).asInstanceOf[mutable.WrappedArray[String]] - val array = wrappedArray.array + val array = row.get(1) match { + case seq: Seq[String] => seq.toArray + case _ => throw new IllegalArgumentException("Unexpected type of array") + } row.get(0) match { case "create" => validateArraysUnordered(createdObjectIds, array) @@ -859,7 +860,7 @@ class SparkE2EChangeFeedITest hdfs.copyToLocalFile(true, new Path(startOffsetFileLocation), new Path(startOffsetFileBackupLocation)) hdfs.exists(new Path(startOffsetFileLocation)) shouldEqual false - var remainingFromLastBatchOfTen = 10; + var remainingFromLastBatchOfTen = 10 while(remainingFromLastBatchOfTen > 0) { hdfs.copyToLocalFile(true, new Path(startOffsetFileBackupLocation), new Path(startOffsetFileLocation)) hdfs.delete(new Path(latestOffsetFileLocation), true) diff --git a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/TestUtils.scala b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/TestUtils.scala index 8eadf4261287..e5040944932a 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/TestUtils.scala +++ b/sdk/cosmos/azure-cosmos-spark_3/src/test/scala/com/azure/cosmos/spark/TestUtils.scala @@ -25,10 +25,7 @@ import java.util.UUID import java.util.concurrent.atomic.AtomicInteger import javax.annotation.concurrent.NotThreadSafe import scala.collection.mutable.ListBuffer -import scala.jdk.CollectionConverters.iterableAsScalaIterableConverter -// scalastyle:off underscore.import -import scala.collection.JavaConverters._ -// scalastyle:on underscore.import +import scala.jdk.CollectionConverters._ // extending class will have a pre-created spark session @NotThreadSafe // marking this as not thread safe because we have to stop Spark Context in some unit tests diff --git a/sdk/cosmos/azure-cosmos-spark_3/test-databricks/databricks-jar-install.sh b/sdk/cosmos/azure-cosmos-spark_3/test-databricks/databricks-jar-install.sh index d361a49014ef..d0a16daa4f67 100644 --- a/sdk/cosmos/azure-cosmos-spark_3/test-databricks/databricks-jar-install.sh +++ b/sdk/cosmos/azure-cosmos-spark_3/test-databricks/databricks-jar-install.sh @@ -3,7 +3,9 @@ CLUSTER_NAME=$1 AVOID_DBFS=$2 JARPATH=$3 -STORAGE_ACCOUNT_KEY=$4 +STORAGE_ACCOUNT_NAME=$4 +STORAGE_ACCOUNT_KEY=$5 +JAR_NAME=$6 [[ -z "$CLUSTER_NAME" ]] && exit 1 [[ -z "$JARPATH" ]] && exit 1 @@ -45,13 +47,13 @@ echo "Avoid DBFS: $AVOID_DBFS" # DATABRICKS_RUNTIME_VERSION is not populated in the environment and version comparison is messy in bash # Using cluster name for the cluster that was created with 16.4 if [[ "${AVOID_DBFS,,}" == "true" ]]; then - account=oltpsparkcijarstore + account=$STORAGE_ACCOUNT_NAME - echo "Uploading jar '$JARPATH/$JARFILE' to Azure Storage account oltpsparkcijarstore (ephemeral tenant) container jarstore BLOB jars/azure-cosmos-spark_3-5_2-12-latest-ci-candidate.jar" - az storage blob upload --account-name oltpsparkcijarstore --account-key $STORAGE_ACCOUNT_KEY --container-name jarstore --name jars/azure-cosmos-spark_3-5_2-12-latest-ci-candidate.jar --file $JARPATH/$JARFILE --type block --overwrite true --only-show-errors + echo "Uploading jar '$JARPATH/$JARFILE' to Azure Storage account $STORAGE_ACCOUNT_NAME (ephemeral tenant) container jarstore BLOB jars/$JAR_NAME" + az storage blob upload --account-name $STORAGE_ACCOUNT_NAME --account-key $STORAGE_ACCOUNT_KEY --container-name jarstore --name jars/$JAR_NAME --file $JARPATH/$JARFILE --type block --overwrite true --only-show-errors if [ $? -eq 0 ]; then - echo "Successfully uploaded JAR to oltpsparkcijarstore (ephemeral tenant)." + echo "Successfully uploaded JAR to $STORAGE_ACCOUNT_NAME (ephemeral tenant)." echo "Rebooting cluster to install new library via init script" else echo "Failed to upload JAR to Workspace Files." diff --git a/sdk/cosmos/ci.yml b/sdk/cosmos/ci.yml index 2f094d0ec3b9..2e1c845dae37 100644 --- a/sdk/cosmos/ci.yml +++ b/sdk/cosmos/ci.yml @@ -18,6 +18,7 @@ trigger: - sdk/cosmos/azure-cosmos-spark_3-4_2-12/ - sdk/cosmos/azure-cosmos-spark_3-5/ - sdk/cosmos/azure-cosmos-spark_3-5_2-12/ + - sdk/cosmos/azure-cosmos-spark_3-5_2-13/ - sdk/cosmos/fabric-cosmos-spark-auth_3/ - sdk/cosmos/azure-cosmos-test/ - sdk/cosmos/azure-cosmos-tests/ @@ -33,6 +34,7 @@ trigger: - sdk/cosmos/azure-cosmos-spark_3-3_2-12/pom.xml - sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml - sdk/cosmos/azure-cosmos-spark_3-5_2-12/pom.xml + - sdk/cosmos/azure-cosmos-spark_3-5_2-13/pom.xml - sdk/cosmos/azure-cosmos-spark_3-5/pom.xml - sdk/cosmos/fabric-cosmos-spark-auth_3/pom.xml - sdk/cosmos/azure-cosmos-kafka-connect/pom.xml @@ -59,6 +61,7 @@ pr: - sdk/cosmos/azure-cosmos-spark_3-4_2-12/ - sdk/cosmos/azure-cosmos-spark_3-5/ - sdk/cosmos/azure-cosmos-spark_3-5_2-12/ + - sdk/cosmos/azure-cosmos-spark_3-5_2-13/ - sdk/cosmos/fabric-cosmos-spark-auth_3/ - sdk/cosmos/faq/ - sdk/cosmos/azure-cosmos-kafka-connect/ @@ -72,6 +75,7 @@ pr: - sdk/cosmos/azure-cosmos-spark_3-4_2-12/pom.xml - sdk/cosmos/azure-cosmos-spark_3-5/pom.xml - sdk/cosmos/azure-cosmos-spark_3-5_2-12/pom.xml + - sdk/cosmos/azure-cosmos-spark_3-5_2-13/pom.xml - sdk/cosmos/fabric-cosmos-spark-auth_3/pom.xml - sdk/cosmos/azure-cosmos-test/pom.xml - sdk/cosmos/azure-cosmos-tests/pom.xml @@ -93,10 +97,14 @@ parameters: displayName: 'azure-cosmos-spark_3-4_2-12' type: boolean default: true - - name: release_azurecosmosspark35 + - name: release_azurecosmosspark35_scala212 displayName: 'azure-cosmos-spark_3-5_2-12' type: boolean default: true + - name: release_azurecosmosspark35_scala213 + displayName: 'azure-cosmos-spark_3-5_2-13' + type: boolean + default: true - name: release_fabriccosmossparkauth3 displayName: 'fabric-cosmos-spark-auth_3' type: boolean @@ -140,11 +148,18 @@ extends: releaseInBatch: ${{ parameters.release_azurecosmosspark34 }} - name: azure-cosmos-spark_3-5_2-12 groupId: com.azure.cosmos.spark - safeName: azurecosmosspark35 + safeName: azurecosmosspark35scala212 + uberJar: true + skipPublishDocGithubIo: true + skipPublishDocMs: true + releaseInBatch: ${{ parameters.release_azurecosmosspark35_scala212 }} + - name: azure-cosmos-spark_3-5_2-13 + groupId: com.azure.cosmos.spark + safeName: azurecosmosspark35scala213 uberJar: true skipPublishDocGithubIo: true skipPublishDocMs: true - releaseInBatch: ${{ parameters.release_azurecosmosspark35 }} + releaseInBatch: ${{ parameters.release_azurecosmosspark35_scala213 }} - name: fabric-cosmos-spark-auth_3 groupId: com.azure.cosmos.spark safeName: fabriccosmossparkauth3 diff --git a/sdk/cosmos/fabric-cosmos-spark-auth_3/pom.xml b/sdk/cosmos/fabric-cosmos-spark-auth_3/pom.xml index 94d7f17c86ad..45524afbe974 100644 --- a/sdk/cosmos/fabric-cosmos-spark-auth_3/pom.xml +++ b/sdk/cosmos/fabric-cosmos-spark-auth_3/pom.xml @@ -176,7 +176,7 @@ org.slf4j:slf4j-api:[1.7.36] org.scala-lang:scala-library:[2.12.19] - org.scala-lang.modules:scala-java8-compat_2.12:[0.8.0] + org.scala-lang.modules:scala-java8-compat_2.12:[0.9.1] org.scalatest:scalatest_2.12:[3.2.2] org.apache.maven.plugins:maven-antrun-plugin:[3.1.0] org.scalastyle:scalastyle-maven-plugin:[1.0.0] diff --git a/sdk/cosmos/pom.xml b/sdk/cosmos/pom.xml index c486b2fe9849..81b2db7ca53e 100644 --- a/sdk/cosmos/pom.xml +++ b/sdk/cosmos/pom.xml @@ -18,6 +18,7 @@ azure-cosmos-spark_3-4_2-12 azure-cosmos-spark_3-5 azure-cosmos-spark_3-5_2-12 + azure-cosmos-spark_3-5_2-13 azure-cosmos-test azure-cosmos-tests azure-cosmos-kafka-connect diff --git a/sdk/cosmos/spark.databricks.yml b/sdk/cosmos/spark.databricks.yml index 50b10d49190f..e7044941e9c9 100644 --- a/sdk/cosmos/spark.databricks.yml +++ b/sdk/cosmos/spark.databricks.yml @@ -34,6 +34,10 @@ parameters: type: string - name: JarReadOnlySasUri type: string + - name: JarStorageAccountName + type: string + - name: JarName + type: string stages: - stage: displayName: 'Spark Databricks integration ${{ parameters.ClusterName }} - ${{ parameters.SparkVersion }}' @@ -91,7 +95,7 @@ stages: displayName: Importing Jars inputs: filePath: $(build.sourcesdirectory)/sdk/cosmos/azure-cosmos-spark_3/test-databricks/databricks-jar-install.sh - arguments: '${{ parameters.ClusterName }} ${{ parameters.AvoidDBFS }} $(build.sourcesdirectory)/sdk/cosmos/${{ parameters.SparkVersion }}/target ${{ parameters.JarStorageAccountKey }}' + arguments: '${{ parameters.ClusterName }} ${{ parameters.AvoidDBFS }} $(build.sourcesdirectory)/sdk/cosmos/${{ parameters.SparkVersion }}/target ${{ parameters.JarStorageAccountName }} ${{ parameters.JarStorageAccountKey }} ${{ parameters.JarName }}' - task: Bash@3 displayName: Importing and executing notebooks inputs: @@ -135,6 +139,6 @@ stages: fi env: JAR_URL: '${{ parameters.JarReadOnlySasUri }}' - JAR_NAME: 'azure-cosmos-spark_3-5_2-12-latest-ci-candidate.jar' + JAR_NAME: '${{ parameters.SparkVersion }}-latest-ci-candidate.jar' JAR_CHECK_SUM: $(JarCheckSum) AVOID_DBFS: ${{ parameters.AvoidDBFS }} diff --git a/sdk/cosmos/spark.yml b/sdk/cosmos/spark.yml index 465a66078343..0dcfd657d0ae 100644 --- a/sdk/cosmos/spark.yml +++ b/sdk/cosmos/spark.yml @@ -26,6 +26,8 @@ stages: ClusterName: 'oltp-ci-spark33-2workers-ds3v2' JarStorageAccountKey: $(spark-databricks-cosmos-spn-clientIdCert) JarReadOnlySasUri: $(spark-databricks-cosmos-spn-clientCertBase64) + JarStorageAccountName: 'oltpsparkcijarstore1225' + JarName: 'azure-cosmos-spark_3-5_2-12-latest-ci-candidate.jar' - template: /sdk/cosmos/spark.databricks.yml parameters: CosmosEndpointMsi: $(spark-databricks-cosmos-endpoint-msi) @@ -44,6 +46,8 @@ stages: ClusterName: 'oltp-ci-spark34-2workers-ds3v2' JarStorageAccountKey: $(spark-databricks-cosmos-spn-clientIdCert) JarReadOnlySasUri: $(spark-databricks-cosmos-spn-clientCertBase64) + JarStorageAccountName: 'oltpsparkcijarstore1225' + JarName: 'azure-cosmos-spark_3-5_2-12-latest-ci-candidate.jar' - template: /sdk/cosmos/spark.databricks.yml parameters: CosmosEndpointMsi: $(spark-databricks-cosmos-endpoint-msi) @@ -63,6 +67,8 @@ stages: AvoidDBFS: false JarStorageAccountKey: $(spark-databricks-cosmos-spn-clientIdCert) JarReadOnlySasUri: $(spark-databricks-cosmos-spn-clientCertBase64) + JarStorageAccountName: 'oltpsparkcijarstore1225' + JarName: 'azure-cosmos-spark_3-5_2-12-latest-ci-candidate.jar' - template: /sdk/cosmos/spark.databricks.yml parameters: CosmosEndpointMsi: $(spark-databricks-cosmos-endpoint-msi) @@ -82,4 +88,26 @@ stages: AvoidDBFS: true JarStorageAccountKey: $(spark-databricks-cosmos-spn-clientIdCert) JarReadOnlySasUri: $(spark-databricks-cosmos-spn-clientCertBase64) - + JarStorageAccountName: 'oltpsparkcijarstore1225' + JarName: 'azure-cosmos-spark_3-5_2-12-latest-ci-candidate.jar' + - template: /sdk/cosmos/spark.databricks.yml + parameters: + CosmosEndpointMsi: $(spark-databricks-cosmos-endpoint-msi) + CosmosEndpoint: $(spark-databricks-cosmos-endpoint) + CosmosKey: $(spark-databricks-cosmos-key) + DatabricksEndpoint: $(spark-databricks-endpoint-with-msi) + SubscriptionId: '8fba6d4f-7c37-4d13-9063-fd58ad2b86e2' + TenantId: '72f988bf-86f1-41af-91ab-2d7cd011db47' + ResourceGroupName: 'oltp-spark-ci' + ClientId: $(spark-databricks-cosmos-spn-clientId) + ClientSecret: $(spark-databricks-cosmos-spn-clientSecret) + CosmosContainerName: 'sampleContainer7' + CosmosDatabaseName: 'sampleDB7' + DatabricksToken: $(spark-databricks-token-with-msi) + SparkVersion: 'azure-cosmos-spark_3-5_2-13' + ClusterName: 'oltp-ci-spark35-2workers-ds3v2-16.4-scala_2.13' + AvoidDBFS: true + JarStorageAccountKey: $(spark-databricks-cosmos-spn-clientIdCert) + JarReadOnlySasUri: $(spark-databricks-token) + JarStorageAccountName: 'oltpsparkcijarstore1225' + JarName: 'azure-cosmos-spark_3-5_2-13-latest-ci-candidate.jar' diff --git a/sdk/dell/azure-resourcemanager-dell-storage/CHANGELOG.md b/sdk/dell/azure-resourcemanager-dell-storage/CHANGELOG.md index e9928f0a30e0..9354c57301d4 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/CHANGELOG.md +++ b/sdk/dell/azure-resourcemanager-dell-storage/CHANGELOG.md @@ -1,14 +1,66 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0 (2025-12-29) -### Features Added +- Azure Resource Manager Dell Storage client library for Java. This package contains Microsoft Azure SDK for Dell Storage Management SDK. Dell Storage service. Package api-version 2025-03-21. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.UserDetails` was modified + +* `validate()` was removed + +#### `models.EncryptionIdentityUpdateProperties` was modified + +* `validate()` was removed + +#### `models.EncryptionIdentityProperties` was modified + +* `validate()` was removed + +#### `models.EncryptionProperties` was modified + +* `validate()` was removed + +#### `models.UserAssignedIdentity` was modified + +* `validate()` was removed + +#### `models.Capacity` was modified + +* `validate()` was removed + +#### `models.FileSystemResourceProperties` was modified + +* `validate()` was removed + +#### `models.MarketplaceDetails` was modified + +* `validate()` was removed + +#### `models.FileSystemResourceUpdateProperties` was modified + +* `validate()` was removed + +#### `models.ManagedServiceIdentityUpdate` was modified + +* `validate()` was removed + +#### `models.ManagedServiceIdentity` was modified + +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `validate()` was removed + +#### `models.EncryptionUpdateProperties` was modified + +* `validate()` was removed + +#### `models.FileSystemResourceUpdate` was modified -### Other Changes +* `validate()` was removed ## 1.0.0-beta.1 (2025-05-08) diff --git a/sdk/dell/azure-resourcemanager-dell-storage/README.md b/sdk/dell/azure-resourcemanager-dell-storage/README.md index 8035c6717772..d9e72bfaaf22 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/README.md +++ b/sdk/dell/azure-resourcemanager-dell-storage/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Dell Storage client library for Java. -This package contains Microsoft Azure SDK for Dell Storage Management SDK. Dell Storage service. Package api-version 2025-03-21-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Dell Storage Management SDK. Dell Storage service. Package api-version 2025-03-21. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-dell-storage - 1.0.0-beta.1 + 1.0.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/dell/azure-resourcemanager-dell-storage/SAMPLE.md b/sdk/dell/azure-resourcemanager-dell-storage/SAMPLE.md index 52e621b4ff51..c71276c82ce3 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/SAMPLE.md +++ b/sdk/dell/azure-resourcemanager-dell-storage/SAMPLE.md @@ -34,7 +34,7 @@ import java.util.Map; */ public final class FileSystemsCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: FileSystems_CreateOrUpdate_MaximumSet_Gen. @@ -74,7 +74,7 @@ public final class FileSystemsCreateOrUpdateSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: FileSystems_CreateOrUpdate_MinimumSet_Gen. @@ -124,7 +124,7 @@ public final class FileSystemsCreateOrUpdateSamples { */ public final class FileSystemsDeleteSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Delete_MaximumSet_Gen.json */ /** * Sample code: FileSystems_Delete_MaximumSet_Gen. @@ -137,7 +137,7 @@ public final class FileSystemsDeleteSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Delete_MinimumSet_Gen.json */ /** * Sample code: FileSystems_Delete_MinimumSet_Gen. @@ -159,7 +159,7 @@ public final class FileSystemsDeleteSamples { */ public final class FileSystemsGetByResourceGroupSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Get_MaximumSet_Gen.json */ /** * Sample code: FileSystems_Get_MaximumSet_Gen. @@ -171,7 +171,7 @@ public final class FileSystemsGetByResourceGroupSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Get_MinimumSet_Gen.json */ /** * Sample code: FileSystems_Get_MinimumSet_Gen. @@ -192,7 +192,7 @@ public final class FileSystemsGetByResourceGroupSamples { */ public final class FileSystemsListSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: FileSystems_ListBySubscription_MinimumSet_Gen. @@ -205,7 +205,7 @@ public final class FileSystemsListSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: FileSystems_ListBySubscription_MaximumSet_Gen. @@ -227,7 +227,7 @@ public final class FileSystemsListSamples { */ public final class FileSystemsListByResourceGroupSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: FileSystems_ListByResourceGroup_MaximumSet_Gen. @@ -240,7 +240,7 @@ public final class FileSystemsListByResourceGroupSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: FileSystems_ListByResourceGroup_MinimumSet_Gen. @@ -275,7 +275,7 @@ import java.util.Map; */ public final class FileSystemsUpdateSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Update_MinimumSet_Gen.json */ /** * Sample code: FileSystems_Update_MinimumSet_Gen. @@ -295,7 +295,7 @@ public final class FileSystemsUpdateSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Update_MaximumSet_Gen.json */ /** * Sample code: FileSystems_Update_MaximumSet_Gen. @@ -346,7 +346,7 @@ public final class FileSystemsUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-03-21-preview/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. @@ -358,7 +358,7 @@ public final class OperationsListSamples { } /* - * x-ms-original-file: 2025-03-21-preview/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. diff --git a/sdk/dell/azure-resourcemanager-dell-storage/pom.xml b/sdk/dell/azure-resourcemanager-dell-storage/pom.xml index 99174032ed27..fefdd33b8978 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/pom.xml +++ b/sdk/dell/azure-resourcemanager-dell-storage/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-dell-storage - 1.0.0-beta.2 + 1.0.0 jar Microsoft Azure SDK for Dell Storage Management - This package contains Microsoft Azure SDK for Dell Storage Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Dell Storage service. Package api-version 2025-03-21-preview. + This package contains Microsoft Azure SDK for Dell Storage Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Dell Storage service. Package api-version 2025-03-21. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,6 @@ UTF-8 0 0 - true diff --git a/sdk/dell/azure-resourcemanager-dell-storage/src/main/java/com/azure/resourcemanager/dell/storage/implementation/DellStorageMgmtClientImpl.java b/sdk/dell/azure-resourcemanager-dell-storage/src/main/java/com/azure/resourcemanager/dell/storage/implementation/DellStorageMgmtClientImpl.java index 374fc2854554..ba2132f88eb8 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/src/main/java/com/azure/resourcemanager/dell/storage/implementation/DellStorageMgmtClientImpl.java +++ b/sdk/dell/azure-resourcemanager-dell-storage/src/main/java/com/azure/resourcemanager/dell/storage/implementation/DellStorageMgmtClientImpl.java @@ -172,7 +172,7 @@ public FileSystemsClient getFileSystems() { this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; this.subscriptionId = subscriptionId; - this.apiVersion = "2025-03-21-preview"; + this.apiVersion = "2025-03-21"; this.operations = new OperationsClientImpl(this); this.fileSystems = new FileSystemsClientImpl(this); } diff --git a/sdk/dell/azure-resourcemanager-dell-storage/src/main/resources/META-INF/azure-resourcemanager-dell-storage_metadata.json b/sdk/dell/azure-resourcemanager-dell-storage/src/main/resources/META-INF/azure-resourcemanager-dell-storage_metadata.json index 8b670fa0e87d..dc76c185ff41 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/src/main/resources/META-INF/azure-resourcemanager-dell-storage_metadata.json +++ b/sdk/dell/azure-resourcemanager-dell-storage/src/main/resources/META-INF/azure-resourcemanager-dell-storage_metadata.json @@ -1 +1 @@ -{"flavor":"azure","apiVersion":"2025-03-21-preview","crossLanguageDefinitions":{"com.azure.resourcemanager.dell.storage.fluent.DellStorageMgmtClient":"Dell.Storage","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient":"Dell.Storage.FileSystems","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.beginCreateOrUpdate":"Dell.Storage.FileSystems.createOrUpdate","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.beginDelete":"Dell.Storage.FileSystems.delete","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.createOrUpdate":"Dell.Storage.FileSystems.createOrUpdate","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.delete":"Dell.Storage.FileSystems.delete","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.getByResourceGroup":"Dell.Storage.FileSystems.get","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.getByResourceGroupWithResponse":"Dell.Storage.FileSystems.get","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.list":"Dell.Storage.FileSystems.listBySubscription","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.listByResourceGroup":"Dell.Storage.FileSystems.listByResourceGroup","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.update":"Dell.Storage.FileSystems.update","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.updateWithResponse":"Dell.Storage.FileSystems.update","com.azure.resourcemanager.dell.storage.fluent.OperationsClient":"Dell.Storage.Operations","com.azure.resourcemanager.dell.storage.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.dell.storage.fluent.models.FileSystemResourceInner":"LiftrBase.Storage.FileSystemResource","com.azure.resourcemanager.dell.storage.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.dell.storage.implementation.DellStorageMgmtClientBuilder":"Dell.Storage","com.azure.resourcemanager.dell.storage.implementation.models.FileSystemResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.dell.storage.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.dell.storage.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.dell.storage.models.Capacity":"LiftrBase.Storage.Capacity","com.azure.resourcemanager.dell.storage.models.EncryptionIdentityProperties":"LiftrBase.EncryptionIdentityProperties","com.azure.resourcemanager.dell.storage.models.EncryptionIdentityType":"LiftrBase.EncryptionIdentityType","com.azure.resourcemanager.dell.storage.models.EncryptionIdentityUpdateProperties":"LiftrBase.EncryptionIdentityUpdateProperties","com.azure.resourcemanager.dell.storage.models.EncryptionProperties":"LiftrBase.EncryptionProperties","com.azure.resourcemanager.dell.storage.models.EncryptionUpdateProperties":"LiftrBase.EncryptionUpdateProperties","com.azure.resourcemanager.dell.storage.models.FileSystemResourceProperties":"LiftrBase.Storage.FileSystemResourceProperties","com.azure.resourcemanager.dell.storage.models.FileSystemResourceUpdate":"LiftrBase.Storage.FileSystemResourceUpdate","com.azure.resourcemanager.dell.storage.models.FileSystemResourceUpdateProperties":"LiftrBase.Storage.FileSystemResourceUpdateProperties","com.azure.resourcemanager.dell.storage.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.dell.storage.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.dell.storage.models.ManagedServiceIdentityUpdate":"LiftrBase.Storage.ManagedServiceIdentityUpdate","com.azure.resourcemanager.dell.storage.models.MarketplaceDetails":"LiftrBase.MarketplaceDetails","com.azure.resourcemanager.dell.storage.models.MarketplaceSubscriptionStatus":"LiftrBase.MarketplaceSubscriptionStatus","com.azure.resourcemanager.dell.storage.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.dell.storage.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.dell.storage.models.ProvisioningState":"LiftrBase.ProvisioningState","com.azure.resourcemanager.dell.storage.models.ResourceEncryptionType":"LiftrBase.ResourceEncryptionType","com.azure.resourcemanager.dell.storage.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.dell.storage.models.UserDetails":"LiftrBase.UserDetails"},"generatedFiles":["src/main/java/com/azure/resourcemanager/dell/storage/DellStorageManager.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/DellStorageMgmtClient.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/FileSystemsClient.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/models/FileSystemResourceInner.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/package-info.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/DellStorageMgmtClientBuilder.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/DellStorageMgmtClientImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/FileSystemResourceImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/FileSystemsClientImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/FileSystemsImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/models/FileSystemResourceListResult.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/package-info.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ActionType.java","src/main/java/com/azure/resourcemanager/dell/storage/models/Capacity.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionIdentityProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionIdentityType.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionIdentityUpdateProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionUpdateProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystemResource.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystemResourceProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystemResourceUpdate.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystemResourceUpdateProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystems.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ManagedServiceIdentityUpdate.java","src/main/java/com/azure/resourcemanager/dell/storage/models/MarketplaceDetails.java","src/main/java/com/azure/resourcemanager/dell/storage/models/MarketplaceSubscriptionStatus.java","src/main/java/com/azure/resourcemanager/dell/storage/models/Operation.java","src/main/java/com/azure/resourcemanager/dell/storage/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/dell/storage/models/Operations.java","src/main/java/com/azure/resourcemanager/dell/storage/models/Origin.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ResourceEncryptionType.java","src/main/java/com/azure/resourcemanager/dell/storage/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/dell/storage/models/UserDetails.java","src/main/java/com/azure/resourcemanager/dell/storage/models/package-info.java","src/main/java/com/azure/resourcemanager/dell/storage/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file +{"flavor":"azure","apiVersion":"2025-03-21","crossLanguageDefinitions":{"com.azure.resourcemanager.dell.storage.fluent.DellStorageMgmtClient":"Dell.Storage","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient":"Dell.Storage.FileSystems","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.beginCreateOrUpdate":"Dell.Storage.FileSystems.createOrUpdate","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.beginDelete":"Dell.Storage.FileSystems.delete","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.createOrUpdate":"Dell.Storage.FileSystems.createOrUpdate","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.delete":"Dell.Storage.FileSystems.delete","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.getByResourceGroup":"Dell.Storage.FileSystems.get","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.getByResourceGroupWithResponse":"Dell.Storage.FileSystems.get","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.list":"Dell.Storage.FileSystems.listBySubscription","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.listByResourceGroup":"Dell.Storage.FileSystems.listByResourceGroup","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.update":"Dell.Storage.FileSystems.update","com.azure.resourcemanager.dell.storage.fluent.FileSystemsClient.updateWithResponse":"Dell.Storage.FileSystems.update","com.azure.resourcemanager.dell.storage.fluent.OperationsClient":"Dell.Storage.Operations","com.azure.resourcemanager.dell.storage.fluent.OperationsClient.list":"Azure.ResourceManager.Operations.list","com.azure.resourcemanager.dell.storage.fluent.models.FileSystemResourceInner":"LiftrBase.Storage.FileSystemResource","com.azure.resourcemanager.dell.storage.fluent.models.OperationInner":"Azure.ResourceManager.CommonTypes.Operation","com.azure.resourcemanager.dell.storage.implementation.DellStorageMgmtClientBuilder":"Dell.Storage","com.azure.resourcemanager.dell.storage.implementation.models.FileSystemResourceListResult":"Azure.ResourceManager.ResourceListResult","com.azure.resourcemanager.dell.storage.implementation.models.OperationListResult":"Azure.ResourceManager.CommonTypes.OperationListResult","com.azure.resourcemanager.dell.storage.models.ActionType":"Azure.ResourceManager.CommonTypes.ActionType","com.azure.resourcemanager.dell.storage.models.Capacity":"LiftrBase.Storage.Capacity","com.azure.resourcemanager.dell.storage.models.EncryptionIdentityProperties":"LiftrBase.EncryptionIdentityProperties","com.azure.resourcemanager.dell.storage.models.EncryptionIdentityType":"LiftrBase.EncryptionIdentityType","com.azure.resourcemanager.dell.storage.models.EncryptionIdentityUpdateProperties":"LiftrBase.EncryptionIdentityUpdateProperties","com.azure.resourcemanager.dell.storage.models.EncryptionProperties":"LiftrBase.EncryptionProperties","com.azure.resourcemanager.dell.storage.models.EncryptionUpdateProperties":"LiftrBase.EncryptionUpdateProperties","com.azure.resourcemanager.dell.storage.models.FileSystemResourceProperties":"LiftrBase.Storage.FileSystemResourceProperties","com.azure.resourcemanager.dell.storage.models.FileSystemResourceUpdate":"LiftrBase.Storage.FileSystemResourceUpdate","com.azure.resourcemanager.dell.storage.models.FileSystemResourceUpdateProperties":"LiftrBase.Storage.FileSystemResourceUpdateProperties","com.azure.resourcemanager.dell.storage.models.ManagedServiceIdentity":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentity","com.azure.resourcemanager.dell.storage.models.ManagedServiceIdentityType":"Azure.ResourceManager.CommonTypes.ManagedServiceIdentityType","com.azure.resourcemanager.dell.storage.models.ManagedServiceIdentityUpdate":"LiftrBase.Storage.ManagedServiceIdentityUpdate","com.azure.resourcemanager.dell.storage.models.MarketplaceDetails":"LiftrBase.MarketplaceDetails","com.azure.resourcemanager.dell.storage.models.MarketplaceSubscriptionStatus":"LiftrBase.MarketplaceSubscriptionStatus","com.azure.resourcemanager.dell.storage.models.OperationDisplay":"Azure.ResourceManager.CommonTypes.OperationDisplay","com.azure.resourcemanager.dell.storage.models.Origin":"Azure.ResourceManager.CommonTypes.Origin","com.azure.resourcemanager.dell.storage.models.ProvisioningState":"LiftrBase.ProvisioningState","com.azure.resourcemanager.dell.storage.models.ResourceEncryptionType":"LiftrBase.ResourceEncryptionType","com.azure.resourcemanager.dell.storage.models.UserAssignedIdentity":"Azure.ResourceManager.CommonTypes.UserAssignedIdentity","com.azure.resourcemanager.dell.storage.models.UserDetails":"LiftrBase.UserDetails"},"generatedFiles":["src/main/java/com/azure/resourcemanager/dell/storage/DellStorageManager.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/DellStorageMgmtClient.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/FileSystemsClient.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/models/FileSystemResourceInner.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/dell/storage/fluent/package-info.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/DellStorageMgmtClientBuilder.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/DellStorageMgmtClientImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/FileSystemResourceImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/FileSystemsClientImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/FileSystemsImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/OperationImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/OperationsImpl.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/ResourceManagerUtils.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/models/FileSystemResourceListResult.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/dell/storage/implementation/package-info.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ActionType.java","src/main/java/com/azure/resourcemanager/dell/storage/models/Capacity.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionIdentityProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionIdentityType.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionIdentityUpdateProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/EncryptionUpdateProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystemResource.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystemResourceProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystemResourceUpdate.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystemResourceUpdateProperties.java","src/main/java/com/azure/resourcemanager/dell/storage/models/FileSystems.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ManagedServiceIdentityType.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ManagedServiceIdentityUpdate.java","src/main/java/com/azure/resourcemanager/dell/storage/models/MarketplaceDetails.java","src/main/java/com/azure/resourcemanager/dell/storage/models/MarketplaceSubscriptionStatus.java","src/main/java/com/azure/resourcemanager/dell/storage/models/Operation.java","src/main/java/com/azure/resourcemanager/dell/storage/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/dell/storage/models/Operations.java","src/main/java/com/azure/resourcemanager/dell/storage/models/Origin.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ProvisioningState.java","src/main/java/com/azure/resourcemanager/dell/storage/models/ResourceEncryptionType.java","src/main/java/com/azure/resourcemanager/dell/storage/models/UserAssignedIdentity.java","src/main/java/com/azure/resourcemanager/dell/storage/models/UserDetails.java","src/main/java/com/azure/resourcemanager/dell/storage/models/package-info.java","src/main/java/com/azure/resourcemanager/dell/storage/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsCreateOrUpdateSamples.java b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsCreateOrUpdateSamples.java index 6e19b44fcbc6..30e5c0d0559f 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsCreateOrUpdateSamples.java +++ b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsCreateOrUpdateSamples.java @@ -22,7 +22,7 @@ */ public final class FileSystemsCreateOrUpdateSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_CreateOrUpdate_MaximumSet_Gen.json */ /** * Sample code: FileSystems_CreateOrUpdate_MaximumSet_Gen. @@ -62,7 +62,7 @@ public final class FileSystemsCreateOrUpdateSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_CreateOrUpdate_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_CreateOrUpdate_MinimumSet_Gen.json */ /** * Sample code: FileSystems_CreateOrUpdate_MinimumSet_Gen. diff --git a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsDeleteSamples.java b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsDeleteSamples.java index f4a48916b339..6e7a6e74b427 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsDeleteSamples.java +++ b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsDeleteSamples.java @@ -9,7 +9,7 @@ */ public final class FileSystemsDeleteSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Delete_MaximumSet_Gen.json */ /** * Sample code: FileSystems_Delete_MaximumSet_Gen. @@ -22,7 +22,7 @@ public final class FileSystemsDeleteSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Delete_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Delete_MinimumSet_Gen.json */ /** * Sample code: FileSystems_Delete_MinimumSet_Gen. diff --git a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsGetByResourceGroupSamples.java b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsGetByResourceGroupSamples.java index 656812d8b172..743c9263f76b 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsGetByResourceGroupSamples.java +++ b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsGetByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class FileSystemsGetByResourceGroupSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Get_MaximumSet_Gen.json */ /** * Sample code: FileSystems_Get_MaximumSet_Gen. @@ -21,7 +21,7 @@ public static void fileSystemsGetMaximumSetGen(com.azure.resourcemanager.dell.st } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Get_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Get_MinimumSet_Gen.json */ /** * Sample code: FileSystems_Get_MinimumSet_Gen. diff --git a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsListByResourceGroupSamples.java b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsListByResourceGroupSamples.java index 88f8c901d212..0a9df004ca34 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsListByResourceGroupSamples.java +++ b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsListByResourceGroupSamples.java @@ -9,7 +9,7 @@ */ public final class FileSystemsListByResourceGroupSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_ListByResourceGroup_MaximumSet_Gen.json */ /** * Sample code: FileSystems_ListByResourceGroup_MaximumSet_Gen. @@ -22,7 +22,7 @@ public final class FileSystemsListByResourceGroupSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_ListByResourceGroup_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_ListByResourceGroup_MinimumSet_Gen.json */ /** * Sample code: FileSystems_ListByResourceGroup_MinimumSet_Gen. diff --git a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsListSamples.java b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsListSamples.java index 6ea214321c38..8df2e72bfc7c 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsListSamples.java +++ b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsListSamples.java @@ -9,7 +9,7 @@ */ public final class FileSystemsListSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_ListBySubscription_MinimumSet_Gen.json */ /** * Sample code: FileSystems_ListBySubscription_MinimumSet_Gen. @@ -22,7 +22,7 @@ public final class FileSystemsListSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_ListBySubscription_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_ListBySubscription_MaximumSet_Gen.json */ /** * Sample code: FileSystems_ListBySubscription_MaximumSet_Gen. diff --git a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsUpdateSamples.java b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsUpdateSamples.java index 67191d5f5329..2aedffcaa5c8 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsUpdateSamples.java +++ b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/FileSystemsUpdateSamples.java @@ -22,7 +22,7 @@ */ public final class FileSystemsUpdateSamples { /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Update_MinimumSet_Gen.json */ /** * Sample code: FileSystems_Update_MinimumSet_Gen. @@ -42,7 +42,7 @@ public final class FileSystemsUpdateSamples { } /* - * x-ms-original-file: 2025-03-21-preview/FileSystems_Update_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/FileSystems_Update_MaximumSet_Gen.json */ /** * Sample code: FileSystems_Update_MaximumSet_Gen. diff --git a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/OperationsListSamples.java b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/OperationsListSamples.java index 8385144a2cde..48c9ca64c4f5 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/OperationsListSamples.java +++ b/sdk/dell/azure-resourcemanager-dell-storage/src/samples/java/com/azure/resourcemanager/dell/storage/generated/OperationsListSamples.java @@ -9,7 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: 2025-03-21-preview/Operations_List_MinimumSet_Gen.json + * x-ms-original-file: 2025-03-21/Operations_List_MinimumSet_Gen.json */ /** * Sample code: Operations_List_MinimumSet_Gen. @@ -21,7 +21,7 @@ public static void operationsListMinimumSetGen(com.azure.resourcemanager.dell.st } /* - * x-ms-original-file: 2025-03-21-preview/Operations_List_MaximumSet_Gen.json + * x-ms-original-file: 2025-03-21/Operations_List_MaximumSet_Gen.json */ /** * Sample code: Operations_List_MaximumSet_Gen. diff --git a/sdk/dell/azure-resourcemanager-dell-storage/tsp-location.yaml b/sdk/dell/azure-resourcemanager-dell-storage/tsp-location.yaml index f79001aaae5d..6de6e549130d 100644 --- a/sdk/dell/azure-resourcemanager-dell-storage/tsp-location.yaml +++ b/sdk/dell/azure-resourcemanager-dell-storage/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/dell/Dell.Storage.Management -commit: 6267b64842af3d744c5b092a3f3beef49729ad6d +commit: be36de931322b23890d3353e06bcc6ad34212877 repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml index 349e0fb60fb8..803536f46a93 100644 --- a/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml +++ b/sdk/eventgrid/azure-resourcemanager-eventgrid/pom.xml @@ -73,7 +73,7 @@ com.azure.resourcemanager azure-resourcemanager - 2.57.0 + 2.58.0 test diff --git a/sdk/eventhubs/azure-messaging-eventhubs/docs/pom.xml b/sdk/eventhubs/azure-messaging-eventhubs/docs/pom.xml index 75d70be681e4..f46543617a70 100644 --- a/sdk/eventhubs/azure-messaging-eventhubs/docs/pom.xml +++ b/sdk/eventhubs/azure-messaging-eventhubs/docs/pom.xml @@ -25,7 +25,7 @@ io.projectreactor reactor-core - 3.7.11 + 3.7.14 diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/CHANGELOG.md b/sdk/healthbot/azure-resourcemanager-healthbot/CHANGELOG.md index 50f9f53217ff..f09ee0a33054 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/CHANGELOG.md +++ b/sdk/healthbot/azure-resourcemanager-healthbot/CHANGELOG.md @@ -1,14 +1,51 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 1.2.0 (2026-01-05) -### Features Added +- Azure Resource Manager Healthbot client library for Java. This package contains Microsoft Azure SDK for Healthbot Management SDK. Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package api-version 2025-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.BotResponseList` was removed -### Other Changes +#### `models.AvailableOperations` was removed + +#### `models.UserAssignedIdentity` was modified + +* `validate()` was removed + +#### `models.HealthBotUpdateParameters` was modified + +* `validate()` was removed + +#### `models.Identity` was modified + +* `validate()` was removed + +#### `models.KeyVaultProperties` was modified + +* `validate()` was removed + +#### `models.HealthBotProperties` was modified + +* `validate()` was removed + +#### `HealthbotManager` was modified + +* `fluent.HealthbotClient serviceClient()` -> `fluent.HealthbotManagementClient serviceClient()` + +#### `models.Sku` was modified + +* `validate()` was removed + +#### `models.OperationDisplay` was modified + +* `OperationDisplay()` was changed to private access +* `withProvider(java.lang.String)` was removed +* `withDescription(java.lang.String)` was removed +* `withResource(java.lang.String)` was removed +* `validate()` was removed +* `withOperation(java.lang.String)` was removed ## 1.1.0 (2025-07-21) diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/README.md b/sdk/healthbot/azure-resourcemanager-healthbot/README.md index f9ab87654b13..c53b96e2ec53 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/README.md +++ b/sdk/healthbot/azure-resourcemanager-healthbot/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Healthbot client library for Java. -This package contains Microsoft Azure SDK for Healthbot Management SDK. Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package tag package-2025-05-25. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Healthbot Management SDK. Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package api-version 2025-11-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-healthbot - 1.1.0 + 1.2.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/SAMPLE.md b/sdk/healthbot/azure-resourcemanager-healthbot/SAMPLE.md index e1852b12f880..468bb6466b28 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/SAMPLE.md +++ b/sdk/healthbot/azure-resourcemanager-healthbot/SAMPLE.md @@ -31,8 +31,7 @@ import java.util.Map; */ public final class BotsCreateSamples { /* - * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2025-05-25/examples/ResourceCreationPut.json + * x-ms-original-file: 2025-11-01/ResourceCreationPut.json */ /** * Sample code: BotCreate. @@ -76,9 +75,7 @@ public final class BotsCreateSamples { */ public final class BotsDeleteSamples { /* - * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2025-05-25/examples/ResourceDeletionDelete. - * json + * x-ms-original-file: 2025-11-01/ResourceDeletionDelete.json */ /** * Sample code: BotDelete. @@ -99,8 +96,7 @@ public final class BotsDeleteSamples { */ public final class BotsGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2025-05-25/examples/ResourceInfoGet.json + * x-ms-original-file: 2025-11-01/ResourceInfoGet.json */ /** * Sample code: ResourceInfoGet. @@ -122,9 +118,7 @@ public final class BotsGetByResourceGroupSamples { */ public final class BotsListSamples { /* - * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2025-05-25/examples/ListBotsBySubscription. - * json + * x-ms-original-file: 2025-11-01/ListBotsBySubscription.json */ /** * Sample code: List Bots by Subscription. @@ -145,9 +139,7 @@ public final class BotsListSamples { */ public final class BotsListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2025-05-25/examples/ListBotsByResourceGroup. - * json + * x-ms-original-file: 2025-11-01/ListBotsByResourceGroup.json */ /** * Sample code: List Bots by Resource Group. @@ -168,8 +160,7 @@ public final class BotsListByResourceGroupSamples { */ public final class BotsListSecretsSamples { /* - * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2025-05-25/examples/ListSecrets.json + * x-ms-original-file: 2025-11-01/ListSecrets.json */ /** * Sample code: Bot List Secrets. @@ -190,9 +181,7 @@ public final class BotsListSecretsSamples { */ public final class BotsRegenerateApiJwtSecretSamples { /* - * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2025-05-25/examples/RegenerateApiJwtSecret. - * json + * x-ms-original-file: 2025-11-01/RegenerateApiJwtSecret.json */ /** * Sample code: Bot Regenerate API JWT Secret. @@ -218,8 +207,7 @@ import com.azure.resourcemanager.healthbot.models.SkuName; */ public final class BotsUpdateSamples { /* - * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2025-05-25/examples/ResourceUpdatePatch.json + * x-ms-original-file: 2025-11-01/ResourceUpdatePatch.json */ /** * Sample code: BotUpdate. @@ -243,8 +231,7 @@ public final class BotsUpdateSamples { */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/healthbot/resource-manager/Microsoft.HealthBot/stable/2025-05-25/examples/GetOperations.json + * x-ms-original-file: 2025-11-01/GetOperations.json */ /** * Sample code: Get Operations. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml b/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml index 1441ff51c97f..4505e1187c77 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml +++ b/sdk/healthbot/azure-resourcemanager-healthbot/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-healthbot - 1.2.0-beta.1 + 1.2.0 jar Microsoft Azure SDK for Healthbot Management - This package contains Microsoft Azure SDK for Healthbot Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package tag package-2025-05-25. + This package contains Microsoft Azure SDK for Healthbot Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. Package api-version 2025-11-01. https://github.com/Azure/azure-sdk-for-java @@ -45,6 +45,7 @@ UTF-8 0 0 + true diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/HealthbotManager.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/HealthbotManager.java index e43b654f0e7f..47f2afaa7732 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/HealthbotManager.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/HealthbotManager.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot; @@ -24,9 +24,9 @@ import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.healthbot.fluent.HealthbotClient; +import com.azure.resourcemanager.healthbot.fluent.HealthbotManagementClient; import com.azure.resourcemanager.healthbot.implementation.BotsImpl; -import com.azure.resourcemanager.healthbot.implementation.HealthbotClientBuilder; +import com.azure.resourcemanager.healthbot.implementation.HealthbotManagementClientBuilder; import com.azure.resourcemanager.healthbot.implementation.OperationsImpl; import com.azure.resourcemanager.healthbot.models.Bots; import com.azure.resourcemanager.healthbot.models.Operations; @@ -44,16 +44,16 @@ * compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. */ public final class HealthbotManager { - private Bots bots; - private Operations operations; - private final HealthbotClient clientObject; + private Bots bots; + + private final HealthbotManagementClient clientObject; private HealthbotManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new HealthbotClientBuilder().pipeline(httpPipeline) + this.clientObject = new HealthbotManagementClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -263,18 +263,6 @@ public HealthbotManager authenticate(TokenCredential credential, AzureProfile pr } } - /** - * Gets the resource collection API of Bots. It manages HealthBot. - * - * @return Resource collection API of Bots. - */ - public Bots bots() { - if (this.bots == null) { - this.bots = new BotsImpl(clientObject.getBots(), this); - } - return bots; - } - /** * Gets the resource collection API of Operations. * @@ -288,12 +276,24 @@ public Operations operations() { } /** - * Gets wrapped service client HealthbotClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. + * Gets the resource collection API of Bots. It manages HealthBot. + * + * @return Resource collection API of Bots. + */ + public Bots bots() { + if (this.bots == null) { + this.bots = new BotsImpl(clientObject.getBots(), this); + } + return bots; + } + + /** + * Gets wrapped service client HealthbotManagementClient providing direct access to the underlying auto-generated + * API implementation, based on Azure REST API. * - * @return Wrapped service client HealthbotClient. + * @return Wrapped service client HealthbotManagementClient. */ - public HealthbotClient serviceClient() { + public HealthbotManagementClient serviceClient() { return this.clientObject; } } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/BotsClient.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/BotsClient.java index ea4c07e35f66..4f080b31e0a9 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/BotsClient.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/BotsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.fluent; @@ -20,10 +20,37 @@ * An instance of this class provides access to all the operations defined in BotsClient. */ public interface BotsClient { + /** + * Get a HealthBot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 HealthBot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String botName, Context context); + + /** + * Get a HealthBot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 HealthBot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + HealthBotInner getByResourceGroup(String resourceGroupName, String botName); + /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -38,7 +65,7 @@ SyncPoller, HealthBotInner> beginCreate(String resour /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @param context The context to associate with this operation. @@ -54,7 +81,7 @@ SyncPoller, HealthBotInner> beginCreate(String resour /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -68,7 +95,7 @@ SyncPoller, HealthBotInner> beginCreate(String resour /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @param context The context to associate with this operation. @@ -80,37 +107,10 @@ SyncPoller, HealthBotInner> beginCreate(String resour @ServiceMethod(returns = ReturnType.SINGLE) HealthBotInner create(String resourceGroupName, String botName, HealthBotInner parameters, Context context); - /** - * Get a HealthBot. - * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 HealthBot along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String botName, Context context); - - /** - * Get a HealthBot. - * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 HealthBot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - HealthBotInner getByResourceGroup(String resourceGroupName, String botName); - /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -125,7 +125,7 @@ SyncPoller, HealthBotInner> beginUpdate(String resour /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @param context The context to associate with this operation. @@ -141,7 +141,7 @@ SyncPoller, HealthBotInner> beginUpdate(String resour /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -155,7 +155,7 @@ SyncPoller, HealthBotInner> beginUpdate(String resour /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @param context The context to associate with this operation. @@ -171,7 +171,7 @@ HealthBotInner update(String resourceGroupName, String botName, HealthBotUpdateP /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -184,7 +184,7 @@ HealthBotInner update(String resourceGroupName, String botName, HealthBotUpdateP /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -198,7 +198,7 @@ HealthBotInner update(String resourceGroupName, String botName, HealthBotUpdateP /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -210,7 +210,7 @@ HealthBotInner update(String resourceGroupName, String botName, HealthBotUpdateP /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -221,105 +221,105 @@ HealthBotInner update(String resourceGroupName, String botName, HealthBotUpdateP void delete(String resourceGroupName, String botName, Context context); /** - * List all secrets of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @param context The context to associate with this operation. + * @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 health Bot Keys Response along with {@link Response}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listSecretsWithResponse(String resourceGroupName, String botName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * List all secrets of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. + * @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 health Bot Keys Response. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - HealthBotKeysResponseInner listSecrets(String resourceGroupName, String botName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Regenerate the API JWT Secret of a HealthBot. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 entry of HealthBotKeysResponse along with {@link Response}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** - * Regenerate the API JWT Secret of a HealthBot. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. + * @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 entry of HealthBotKeysResponse. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - HealthBotKeyInner regenerateApiJwtSecret(String resourceGroupName, String botName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); /** - * Returns all the resources of a particular type belonging to a resource group. + * List all secrets of a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return health Bot Keys Response along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response listSecretsWithResponse(String resourceGroupName, String botName, + Context context); /** - * Returns all the resources of a particular type belonging to a resource group. + * List all secrets of a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return health Bot Keys Response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + HealthBotKeysResponseInner listSecrets(String resourceGroupName, String botName); /** - * Returns all the resources of a particular type belonging to a subscription. + * Regenerate the API JWT Secret of a HealthBot. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return an entry of HealthBotKeysResponse along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, + Context context); /** - * Returns all the resources of a particular type belonging to a subscription. + * Regenerate the API JWT Secret of a HealthBot. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return an entry of HealthBotKeysResponse. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + HealthBotKeyInner regenerateApiJwtSecret(String resourceGroupName, String botName); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/HealthbotClient.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/HealthbotManagementClient.java similarity index 79% rename from sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/HealthbotClient.java rename to sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/HealthbotManagementClient.java index 8e3431b9b3e4..46f826c5c5f2 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/HealthbotClient.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/HealthbotManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for HealthbotClient class. + * The interface for HealthbotManagementClient class. */ -public interface HealthbotClient { +public interface HealthbotManagementClient { /** - * Gets Azure Subscription ID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -47,16 +47,16 @@ public interface HealthbotClient { Duration getDefaultPollInterval(); /** - * Gets the BotsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the BotsClient object. + * @return the OperationsClient object. */ - BotsClient getBots(); + OperationsClient getOperations(); /** - * Gets the OperationsClient object to access its operations. + * Gets the BotsClient object to access its operations. * - * @return the OperationsClient object. + * @return the BotsClient object. */ - OperationsClient getOperations(); + BotsClient getBots(); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/OperationsClient.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/OperationsClient.java index f115cb7a7bfb..960479c6b996 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/OperationsClient.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.fluent; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotInner.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotInner.java index 7f6bc2a18077..7a0252308876 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotInner.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotInner.java @@ -1,13 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -22,6 +21,11 @@ */ @Fluent public final class HealthBotInner extends Resource { + /* + * The set of properties specific to Azure Health Bot resource. + */ + private HealthBotProperties properties; + /* * SKU of the Azure Health Bot. */ @@ -33,12 +37,7 @@ public final class HealthBotInner extends Resource { private Identity identity; /* - * The set of properties specific to Azure Health Bot resource. - */ - private HealthBotProperties properties; - - /* - * Metadata pertaining to creation and last modification of the resource + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -63,6 +62,26 @@ public final class HealthBotInner extends Resource { public HealthBotInner() { } + /** + * Get the properties property: The set of properties specific to Azure Health Bot resource. + * + * @return the properties value. + */ + public HealthBotProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The set of properties specific to Azure Health Bot resource. + * + * @param properties the properties value to set. + * @return the HealthBotInner object itself. + */ + public HealthBotInner withProperties(HealthBotProperties properties) { + this.properties = properties; + return this; + } + /** * Get the sku property: SKU of the Azure Health Bot. * @@ -104,27 +123,7 @@ public HealthBotInner withIdentity(Identity identity) { } /** - * Get the properties property: The set of properties specific to Azure Health Bot resource. - * - * @return the properties value. - */ - public HealthBotProperties properties() { - return this.properties; - } - - /** - * Set the properties property: The set of properties specific to Azure Health Bot resource. - * - * @param properties the properties value to set. - * @return the HealthBotInner object itself. - */ - public HealthBotInner withProperties(HealthBotProperties properties) { - this.properties = properties; - return this; - } - - /** - * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -180,28 +179,6 @@ public HealthBotInner withTags(Map tags) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (sku() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property sku in model HealthBotInner")); - } else { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - if (properties() != null) { - properties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(HealthBotInner.class); - /** * {@inheritDoc} */ @@ -211,8 +188,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("sku", this.sku); - jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -245,10 +222,10 @@ public static HealthBotInner fromJson(JsonReader jsonReader) throws IOException deserializedHealthBotInner.withTags(tags); } else if ("sku".equals(fieldName)) { deserializedHealthBotInner.sku = Sku.fromJson(reader); - } else if ("identity".equals(fieldName)) { - deserializedHealthBotInner.identity = Identity.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedHealthBotInner.properties = HealthBotProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedHealthBotInner.identity = Identity.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedHealthBotInner.systemData = SystemData.fromJson(reader); } else { diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeyInner.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeyInner.java index 0a60b570841b..611b317712d5 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeyInner.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/HealthBotKeyInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * An entry of HealthBotKeysResponse. */ -@Fluent +@Immutable public final class HealthBotKeyInner implements JsonSerializable { /* * The name of the key. @@ -29,7 +29,7 @@ public final class HealthBotKeyInner implements JsonSerializable { /* * Array of Azure Health Bot Secrets. @@ -25,7 +25,7 @@ public final class HealthBotKeysResponseInner implements JsonSerializable secrets() { return this.secrets; } - /** - * Set the secrets property: Array of Azure Health Bot Secrets. - * - * @param secrets the secrets value to set. - * @return the HealthBotKeysResponseInner object itself. - */ - public HealthBotKeysResponseInner withSecrets(List secrets) { - this.secrets = secrets; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (secrets() != null) { - secrets().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/OperationDetailInner.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/OperationDetailInner.java index 2f1ecc5453dc..1832ded80a3a 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/OperationDetailInner.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/fluent/models/OperationDetailInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Operation detail payload. */ -@Fluent +@Immutable public final class OperationDetailInner implements JsonSerializable { /* * Name of the operation @@ -45,7 +45,7 @@ public final class OperationDetailInner implements JsonSerializable>> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") HealthBotInner parameters, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response createSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") HealthBotInner parameters, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HealthBotInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response getByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HealthBotInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HealthBotUpdateParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HealthBotUpdateParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response updateSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") HealthBotUpdateParameters parameters, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") HealthBotUpdateParameters parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response deleteSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/listSecrets") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSecrets(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/listSecrets") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSecretsSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/regenerateApiJwtSecret") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HealthBot/healthBots") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> regenerateApiJwtSecret(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + 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" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/regenerateApiJwtSecret") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HealthBot/healthBots") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response regenerateApiJwtSecretSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Response listSync(@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}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/listSecrets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> listSecrets(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/listSecrets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listByResourceGroupSync(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response listSecretsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HealthBot/healthBots") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/regenerateApiJwtSecret") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> regenerateApiJwtSecret(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.HealthBot/healthBots") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HealthBot/healthBots/{botName}/regenerateApiJwtSecret") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Response regenerateApiJwtSecretSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("botName") String botName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -229,7 +222,7 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -237,7 +230,7 @@ Mono> listByResourceGroupNext( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Response listByResourceGroupNextSync( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -245,20 +238,90 @@ Response listByResourceGroupNextSync( @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @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("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a HealthBot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 HealthBot along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String botName) { + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a HealthBot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 HealthBot on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String botName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, botName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a HealthBot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 HealthBot along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String botName, + Context context) { + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, accept, context); + } + + /** + * Get a HealthBot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 HealthBot. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HealthBotInner getByResourceGroup(String resourceGroupName, String botName) { + return getByResourceGroupWithResponse(resourceGroupName, botName, Context.NONE).getValue(); } /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -270,37 +333,18 @@ Response listNextSync(@PathParam(value = "nextLink", encoded = @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createWithResponseAsync(String resourceGroupName, String botName, HealthBotInner parameters) { - 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 (botName == null) { - return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, botName, this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -311,39 +355,16 @@ private Mono>> createWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String botName, HealthBotInner parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (botName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - botName, this.client.getApiVersion(), parameters, accept, Context.NONE); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, contentType, accept, parameters, Context.NONE); } /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @param context The context to associate with this operation. @@ -355,39 +376,16 @@ private Response createWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response createWithResponse(String resourceGroupName, String botName, HealthBotInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (botName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.createSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - botName, this.client.getApiVersion(), parameters, accept, context); + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, contentType, accept, parameters, context); } /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -406,7 +404,7 @@ private PollerFlux, HealthBotInner> beginCreateAsync( /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -425,7 +423,7 @@ public SyncPoller, HealthBotInner> beginCreate(String /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @param context The context to associate with this operation. @@ -445,7 +443,7 @@ public SyncPoller, HealthBotInner> beginCreate(String /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -462,7 +460,7 @@ private Mono createAsync(String resourceGroupName, String botNam /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -478,7 +476,7 @@ public HealthBotInner create(String resourceGroupName, String botName, HealthBot /** * Create a new Azure Health Bot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the created Azure Health Bot. * @param context The context to associate with this operation. @@ -492,114 +490,10 @@ public HealthBotInner create(String resourceGroupName, String botName, HealthBot return beginCreate(resourceGroupName, botName, parameters, context).getFinalResult(); } - /** - * Get a HealthBot. - * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 HealthBot along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String botName) { - 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 (botName == null) { - return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, botName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a HealthBot. - * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 HealthBot on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String botName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, botName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a HealthBot. - * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 HealthBot along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String botName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (botName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, botName, this.client.getApiVersion(), accept, context); - } - - /** - * Get a HealthBot. - * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 HealthBot. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HealthBotInner getByResourceGroup(String resourceGroupName, String botName) { - return getByResourceGroupWithResponse(resourceGroupName, botName, Context.NONE).getValue(); - } - /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -611,37 +505,18 @@ public HealthBotInner getByResourceGroup(String resourceGroupName, String botNam @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String botName, HealthBotUpdateParameters parameters) { - 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 (botName == null) { - return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, botName, this.client.getApiVersion(), parameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -652,39 +527,16 @@ private Mono>> updateWithResponseAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String botName, HealthBotUpdateParameters parameters) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (botName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - botName, this.client.getApiVersion(), parameters, accept, Context.NONE); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, contentType, accept, parameters, Context.NONE); } /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @param context The context to associate with this operation. @@ -696,39 +548,16 @@ private Response updateWithResponse(String resourceGroupName, String @ServiceMethod(returns = ReturnType.SINGLE) private Response updateWithResponse(String resourceGroupName, String botName, HealthBotUpdateParameters parameters, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (botName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - if (parameters == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } + final String contentType = "application/json"; final String accept = "application/json"; - return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - botName, this.client.getApiVersion(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, contentType, accept, parameters, context); } /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -747,7 +576,7 @@ private PollerFlux, HealthBotInner> beginUpdateAsync( /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -766,7 +595,7 @@ public SyncPoller, HealthBotInner> beginUpdate(String /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @param context The context to associate with this operation. @@ -786,7 +615,7 @@ public SyncPoller, HealthBotInner> beginUpdate(String /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -804,7 +633,7 @@ private Mono updateAsync(String resourceGroupName, String botNam /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -820,7 +649,7 @@ public HealthBotInner update(String resourceGroupName, String botName, HealthBot /** * Patch a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param parameters The parameters to provide for the required Azure Health Bot. * @param context The context to associate with this operation. @@ -838,7 +667,7 @@ public HealthBotInner update(String resourceGroupName, String botName, HealthBot /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -847,32 +676,16 @@ public HealthBotInner update(String resourceGroupName, String botName, HealthBot */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteWithResponseAsync(String resourceGroupName, String botName) { - 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 (botName == null) { - return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, botName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -881,33 +694,14 @@ private Mono>> deleteWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String botName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (botName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - botName, this.client.getApiVersion(), accept, Context.NONE); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, Context.NONE); } /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -917,33 +711,14 @@ private Response deleteWithResponse(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) private Response deleteWithResponse(String resourceGroupName, String botName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (botName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - botName, this.client.getApiVersion(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, context); } /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -960,7 +735,7 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -976,7 +751,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -993,7 +768,7 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1008,7 +783,7 @@ private Mono deleteAsync(String resourceGroupName, String botName) { /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1022,7 +797,7 @@ public void delete(String resourceGroupName, String botName) { /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1035,296 +810,159 @@ public void delete(String resourceGroupName, String botName, Context context) { } /** - * List all secrets of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. + * @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 health Bot Keys Response along with {@link Response} on successful completion of {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSecretsWithResponseAsync(String resourceGroupName, - String botName) { - 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 (botName == null) { - return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, botName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, 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 all secrets of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. + * @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 health Bot Keys Response on successful completion of {@link Mono}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listSecretsAsync(String resourceGroupName, String botName) { - return listSecretsWithResponseAsync(resourceGroupName, botName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * List all secrets of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @param context The context to associate with this operation. + * @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 health Bot Keys Response along with {@link Response}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listSecretsWithResponse(String resourceGroupName, String botName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (botName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { final String accept = "application/json"; - return service.listSecretsSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - botName, this.client.getApiVersion(), accept, context); - } - - /** - * List all secrets of a HealthBot. - * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 health Bot Keys Response. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HealthBotKeysResponseInner listSecrets(String resourceGroupName, String botName) { - return listSecretsWithResponse(resourceGroupName, botName, Context.NONE).getValue(); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Regenerate the API JWT Secret of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an entry of HealthBotKeysResponse along with {@link Response} on successful completion of {@link Mono}. + * @return the list of Azure Health Bot operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateApiJwtSecretWithResponseAsync(String resourceGroupName, - String botName) { - 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 (botName == null) { - return Mono.error(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.regenerateApiJwtSecret(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, botName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Regenerate the API JWT Secret of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. + * @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 an entry of HealthBotKeysResponse on successful completion of {@link Mono}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono regenerateApiJwtSecretAsync(String resourceGroupName, String botName) { - return regenerateApiJwtSecretWithResponseAsync(resourceGroupName, botName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Regenerate the API JWT Secret of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return an entry of HealthBotKeysResponse along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, - Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (botName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter botName is required and cannot be null.")); - } - final String accept = "application/json"; - return service.regenerateApiJwtSecretSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, botName, this.client.getApiVersion(), accept, context); - } - - /** - * Regenerate the API JWT Secret of a HealthBot. - * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 entry of HealthBotKeysResponse. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public HealthBotKeyInner regenerateApiJwtSecret(String resourceGroupName, String botName) { - return regenerateApiJwtSecretWithResponse(resourceGroupName, botName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Returns all the resources of a particular type belonging to a resource group. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @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 list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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.")); - } + private Mono> listSinglePageAsync() { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(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())); } /** - * Returns all the resources of a particular type belonging to a resource group. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @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 list of Azure Health Bot operation response as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Returns all the resources of a particular type belonging to a resource group. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @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 list of Azure Health Bot operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private PagedResponse listSinglePage() { final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, Context.NONE); + Response res = service.listSync(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); } /** - * Returns all the resources of a particular type belonging to a resource group. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user 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. @@ -1332,47 +970,29 @@ private PagedResponse listByResourceGroupSinglePage(String resou * @return the list of Azure Health Bot operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + private PagedResponse listSinglePage(Context context) { final String accept = "application/json"; - Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, - this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context); + Response res = service.listSync(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); } /** - * Returns all the resources of a particular type belonging to a resource group. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePage(nextLink)); + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** - * Returns all the resources of a particular type belonging to a resource group. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user 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. @@ -1380,128 +1000,149 @@ public PagedIterable listByResourceGroup(String resourceGroupNam * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** - * Returns all the resources of a particular type belonging to a subscription. + * List all secrets of a HealthBot. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 list of Azure Health Bot operation response along with {@link PagedResponse} on successful completion - * of {@link Mono}. + * @return health Bot Keys Response along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - 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.")); - } + private Mono> listSecretsWithResponseAsync(String resourceGroupName, + String botName) { final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .withContext(context -> service.listSecrets(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns all the resources of a particular type belonging to a subscription. + * List all secrets of a HealthBot. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 list of Azure Health Bot operation response as paginated response with {@link PagedFlux}. + * @return health Bot Keys Response on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSecretsAsync(String resourceGroupName, String botName) { + return listSecretsWithResponseAsync(resourceGroupName, botName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Returns all the resources of a particular type belonging to a subscription. + * List all secrets of a HealthBot. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 list of Azure Health Bot operation response along with {@link PagedResponse}. + * @return health Bot Keys Response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public Response listSecretsWithResponse(String resourceGroupName, String botName, + Context context) { final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, Context.NONE); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return service.listSecretsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, accept, context); } /** - * Returns all the resources of a particular type belonging to a subscription. + * List all secrets of a HealthBot. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. * @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 list of Azure Health Bot operation response along with {@link PagedResponse}. + * @return health Bot Keys Response. */ @ServiceMethod(returns = ReturnType.SINGLE) - private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } + public HealthBotKeysResponseInner listSecrets(String resourceGroupName, String botName) { + return listSecretsWithResponse(resourceGroupName, botName, Context.NONE).getValue(); + } + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 entry of HealthBotKeysResponse along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> regenerateApiJwtSecretWithResponseAsync(String resourceGroupName, + String botName) { final String accept = "application/json"; - Response res = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context); - return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), - res.getValue().nextLink(), null); + return FluxUtil + .withContext( + context -> service.regenerateApiJwtSecret(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Returns all the resources of a particular type belonging to a subscription. + * Regenerate the API JWT Secret of a HealthBot. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return an entry of HealthBotKeysResponse on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono regenerateApiJwtSecretAsync(String resourceGroupName, String botName) { + return regenerateApiJwtSecretWithResponseAsync(resourceGroupName, botName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Returns all the resources of a particular type belonging to a subscription. + * Regenerate the API JWT Secret of a HealthBot. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return an entry of HealthBotKeysResponse along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, + Context context) { + final String accept = "application/json"; + return service.regenerateApiJwtSecretSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, botName, accept, context); + } + + /** + * Regenerate the API JWT Secret of a HealthBot. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 entry of HealthBotKeysResponse. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public HealthBotKeyInner regenerateApiJwtSecret(String resourceGroupName, String botName) { + return regenerateApiJwtSecretWithResponse(resourceGroupName, botName, Context.NONE).getValue(); } /** @@ -1516,13 +1157,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByResourceGroupNextSinglePageAsync(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( @@ -1543,15 +1177,6 @@ private Mono> listByResourceGroupNextSinglePageAsy */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -1571,15 +1196,6 @@ private PagedResponse listByResourceGroupNextSinglePage(String n */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); @@ -1599,13 +1215,6 @@ private PagedResponse listByResourceGroupNextSinglePage(String n */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), @@ -1624,15 +1233,6 @@ private Mono> listNextSinglePageAsync(String nextL */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } 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(), @@ -1651,20 +1251,9 @@ private PagedResponse listNextSinglePage(String nextLink) { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } 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); } - - private static final ClientLogger LOGGER = new ClientLogger(BotsClientImpl.class); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsImpl.java index 721301798b4d..9f0d202dc9d5 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/BotsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; @@ -59,6 +59,26 @@ public void delete(String resourceGroupName, String botName, Context context) { this.serviceClient().delete(resourceGroupName, botName, context); } + public PagedIterable listByResourceGroup(String resourceGroupName) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager())); + } + + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager())); + } + + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager())); + } + + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager())); + } + public Response listSecretsWithResponse(String resourceGroupName, String botName, Context context) { Response inner @@ -101,26 +121,6 @@ public HealthBotKey regenerateApiJwtSecret(String resourceGroupName, String botN } } - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager())); - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new HealthBotImpl(inner1, this.manager())); - } - public HealthBot getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotImpl.java index f1c7f5559b66..52334c17117d 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; @@ -49,6 +49,10 @@ public Map tags() { } } + public HealthBotProperties properties() { + return this.innerModel().properties(); + } + public Sku sku() { return this.innerModel().sku(); } @@ -57,10 +61,6 @@ public Identity identity() { return this.innerModel().identity(); } - public HealthBotProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } @@ -202,22 +202,22 @@ public HealthBotImpl withTags(Map tags) { } } - public HealthBotImpl withIdentity(Identity identity) { + public HealthBotImpl withProperties(HealthBotProperties properties) { if (isInCreateMode()) { - this.innerModel().withIdentity(identity); + this.innerModel().withProperties(properties); return this; } else { - this.updateParameters.withIdentity(identity); + this.updateParameters.withProperties(properties); return this; } } - public HealthBotImpl withProperties(HealthBotProperties properties) { + public HealthBotImpl withIdentity(Identity identity) { if (isInCreateMode()) { - this.innerModel().withProperties(properties); + this.innerModel().withIdentity(identity); return this; } else { - this.updateParameters.withProperties(properties); + this.updateParameters.withIdentity(identity); return this; } } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeyImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeyImpl.java index 06f8b9d56b9d..a1ce425218db 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeyImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeyImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeysResponseImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeysResponseImpl.java index 06d843b817cc..286663789eaf 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeysResponseImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthBotKeysResponseImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientBuilder.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotManagementClientBuilder.java similarity index 63% rename from sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientBuilder.java rename to sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotManagementClientBuilder.java index 7d8818fba68e..71a1d1c6f7f9 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientBuilder.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the HealthbotClientImpl type. + * A builder for creating a new instance of the HealthbotManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = { HealthbotClientImpl.class }) -public final class HealthbotClientBuilder { +@ServiceClientBuilder(serviceClients = { HealthbotManagementClientImpl.class }) +public final class HealthbotManagementClientBuilder { /* - * Azure Subscription ID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets Azure Subscription ID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the HealthbotClientBuilder. + * @param endpoint the endpoint value. + * @return the HealthbotManagementClientBuilder. */ - public HealthbotClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public HealthbotManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the HealthbotClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the HealthbotManagementClientBuilder. */ - public HealthbotClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public HealthbotManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public HealthbotClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the HealthbotClientBuilder. + * @return the HealthbotManagementClientBuilder. */ - public HealthbotClientBuilder environment(AzureEnvironment environment) { + public HealthbotManagementClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public HealthbotClientBuilder environment(AzureEnvironment environment) { * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the HealthbotClientBuilder. + * @return the HealthbotManagementClientBuilder. */ - public HealthbotClientBuilder pipeline(HttpPipeline pipeline) { + public HealthbotManagementClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public HealthbotClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the HealthbotClientBuilder. + * @return the HealthbotManagementClientBuilder. */ - public HealthbotClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public HealthbotManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public HealthbotClientBuilder defaultPollInterval(Duration defaultPollInterval) * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the HealthbotClientBuilder. + * @return the HealthbotManagementClientBuilder. */ - public HealthbotClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public HealthbotManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of HealthbotClientImpl with the provided parameters. + * Builds an instance of HealthbotManagementClientImpl with the provided parameters. * - * @return an instance of HealthbotClientImpl. + * @return an instance of HealthbotManagementClientImpl. */ - public HealthbotClientImpl buildClient() { + public HealthbotManagementClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public HealthbotClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - HealthbotClientImpl client = new HealthbotClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + HealthbotManagementClientImpl client = new HealthbotManagementClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotManagementClientImpl.java similarity index 90% rename from sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientImpl.java rename to sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotManagementClientImpl.java index b07aec2814aa..73561471376b 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotClientImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/HealthbotManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.healthbot.fluent.BotsClient; -import com.azure.resourcemanager.healthbot.fluent.HealthbotClient; +import com.azure.resourcemanager.healthbot.fluent.HealthbotManagementClient; import com.azure.resourcemanager.healthbot.fluent.OperationsClient; import java.io.IOException; import java.lang.reflect.Type; @@ -39,31 +39,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the HealthbotClientImpl type. + * Initializes a new instance of the HealthbotManagementClientImpl type. */ -@ServiceClient(builder = HealthbotClientBuilder.class) -public final class HealthbotClientImpl implements HealthbotClient { +@ServiceClient(builder = HealthbotManagementClientBuilder.class) +public final class HealthbotManagementClientImpl implements HealthbotManagementClient { /** - * Azure Subscription ID. - */ - private final String subscriptionId; - - /** - * Gets Azure Subscription ID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -72,12 +58,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -85,6 +71,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -128,53 +128,53 @@ public Duration getDefaultPollInterval() { } /** - * The BotsClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final BotsClient bots; + private final OperationsClient operations; /** - * Gets the BotsClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the BotsClient object. + * @return the OperationsClient object. */ - public BotsClient getBots() { - return this.bots; + public OperationsClient getOperations() { + return this.operations; } /** - * The OperationsClient object to access its operations. + * The BotsClient object to access its operations. */ - private final OperationsClient operations; + private final BotsClient bots; /** - * Gets the OperationsClient object to access its operations. + * Gets the BotsClient object to access its operations. * - * @return the OperationsClient object. + * @return the BotsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public BotsClient getBots() { + return this.bots; } /** - * Initializes an instance of HealthbotClient client. + * Initializes an instance of HealthbotManagementClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId Azure Subscription ID. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ - HealthbotClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, Duration defaultPollInterval, - AzureEnvironment environment, String subscriptionId, String endpoint) { + HealthbotManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2025-05-25"; - this.bots = new BotsClientImpl(this); + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-11-01"; this.operations = new OperationsClientImpl(this); + this.bots = new BotsClientImpl(this); } /** @@ -320,5 +320,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(HealthbotClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(HealthbotManagementClientImpl.class); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationDetailImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationDetailImpl.java index fb42dad0bbf5..4284d9af0042 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationDetailImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationDetailImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsClientImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsClientImpl.java index bb48662e5fdd..5ff53f29a8e9 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsClientImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; @@ -25,10 +25,9 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; -import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.healthbot.fluent.OperationsClient; import com.azure.resourcemanager.healthbot.fluent.models.OperationDetailInner; -import com.azure.resourcemanager.healthbot.models.AvailableOperations; +import com.azure.resourcemanager.healthbot.implementation.models.AvailableOperations; import reactor.core.publisher.Mono; /** @@ -43,38 +42,38 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final HealthbotClientImpl client; + private final HealthbotManagementClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(HealthbotClientImpl client) { + OperationsClientImpl(HealthbotManagementClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for HealthbotClientOperations to be used by the proxy service to perform - * REST calls. + * The interface defining all the services for HealthbotManagementClientOperations to be used by the proxy service + * to perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "HealthbotClientOperations") + @Host("{endpoint}") + @ServiceInterface(name = "HealthbotManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.HealthBot/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.HealthBot/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Response listSync(@HostParam("$host") String endpoint, + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -82,14 +81,14 @@ Response listSync(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @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("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -102,10 +101,6 @@ Response listNextSync(@PathParam(value = "nextLink", encode */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listSinglePageAsync() { - 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( @@ -136,11 +131,6 @@ private PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage() { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); @@ -159,11 +149,6 @@ private PagedResponse listSinglePage() { */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listSinglePage(Context context) { - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); @@ -209,13 +194,6 @@ public PagedIterable list(Context context) { */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(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.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), @@ -234,15 +212,6 @@ private Mono> listNextSinglePageAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } final String accept = "application/json"; Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); @@ -262,20 +231,9 @@ private PagedResponse listNextSinglePage(String nextLink) */ @ServiceMethod(returns = ReturnType.SINGLE) private PagedResponse listNextSinglePage(String nextLink, Context context) { - if (nextLink == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } 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); } - - private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsImpl.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsImpl.java index 4debd161871e..c5588ae7e84d 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsImpl.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/ResourceManagerUtils.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/ResourceManagerUtils.java index 0d785497dbcf..4136bed06dc8 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/ResourceManagerUtils.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/ResourceManagerUtils.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.implementation; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/AvailableOperations.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/models/AvailableOperations.java similarity index 71% rename from sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/AvailableOperations.java rename to sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/models/AvailableOperations.java index e11f8241f6e4..0e2fd4268339 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/AvailableOperations.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/models/AvailableOperations.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.healthbot.models; +package com.azure.resourcemanager.healthbot.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,10 +16,10 @@ /** * Available operations of the service. */ -@Fluent +@Immutable public final class AvailableOperations implements JsonSerializable { /* - * Collection of available operation details + * Collection of available operation details. */ private List value; @@ -32,7 +32,7 @@ public final class AvailableOperations implements JsonSerializable value() { return this.value; } - /** - * Set the value property: Collection of available operation details. - * - * @param value the value value to set. - * @return the AvailableOperations object itself. - */ - public AvailableOperations withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: URL client should use to fetch the next page (per server side paging). * It's null for now, added for future use. @@ -65,29 +54,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: URL client should use to fetch the next page (per server side paging). - * It's null for now, added for future use. - * - * @param nextLink the nextLink value to set. - * @return the AvailableOperations object itself. - */ - public AvailableOperations withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - /** * {@inheritDoc} */ @@ -105,6 +71,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of AvailableOperations 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 AvailableOperations. */ public static AvailableOperations fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/BotResponseList.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/models/BotResponseList.java similarity index 74% rename from sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/BotResponseList.java rename to sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/models/BotResponseList.java index 8dc65ca3fc69..e2b595ecef9f 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/BotResponseList.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/models/BotResponseList.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.healthbot.models; +package com.azure.resourcemanager.healthbot.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -19,32 +19,23 @@ @Immutable public final class BotResponseList implements JsonSerializable { /* - * The link used to get the next page of bot service resources. + * The HealthBot items on this page */ - private String nextLink; + private List value; /* - * Gets the list of Azure Health Bot results and their properties. + * The link to the next page of items */ - private List value; + private String nextLink; /** * Creates an instance of BotResponseList class. */ - public BotResponseList() { + private BotResponseList() { } /** - * Get the nextLink property: The link used to get the next page of bot service resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Get the value property: Gets the list of Azure Health Bot results and their properties. + * Get the value property: The HealthBot items on this page. * * @return the value value. */ @@ -53,14 +44,12 @@ public List value() { } /** - * Validates the instance. + * Get the nextLink property: The link to the next page of items. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @return the nextLink value. */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } + public String nextLink() { + return this.nextLink; } /** @@ -69,6 +58,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +68,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of BotResponseList 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 BotResponseList. */ public static BotResponseList fromJson(JsonReader jsonReader) throws IOException { @@ -87,11 +78,11 @@ public static BotResponseList fromJson(JsonReader jsonReader) throws IOException String fieldName = reader.getFieldName(); reader.nextToken(); - if ("nextLink".equals(fieldName)) { - deserializedBotResponseList.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { + if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> HealthBotInner.fromJson(reader1)); deserializedBotResponseList.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedBotResponseList.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/package-info.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/package-info.java index 49fb29b674c4..8cdb71eb9f9f 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/package-info.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for HealthbotClient. + * Package containing the implementations for HealthbotManagementClient. * Azure Health Bot is a cloud platform that empowers developers in Healthcare organizations to build and deploy their * compliant, AI-powered virtual health assistants and health bots, that help them improve processes and reduce costs. */ diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Bots.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Bots.java index a6fce596ad43..f63da70468f3 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Bots.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Bots.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; @@ -15,7 +15,7 @@ public interface Bots { /** * Get a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -28,7 +28,7 @@ public interface Bots { /** * Get a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -40,7 +40,7 @@ public interface Bots { /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -51,7 +51,7 @@ public interface Bots { /** * Delete a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param botName The name of the Bot resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -61,98 +61,98 @@ public interface Bots { void delete(String resourceGroupName, String botName, Context context); /** - * List all secrets of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @param context The context to associate with this operation. + * @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 health Bot Keys Response along with {@link Response}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - Response listSecretsWithResponse(String resourceGroupName, String botName, Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * List all secrets of a HealthBot. + * Returns all the resources of a particular type belonging to a resource group. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. + * @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 health Bot Keys Response. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - HealthBotKeysResponse listSecrets(String resourceGroupName, String botName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Regenerate the API JWT Secret of a HealthBot. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. - * @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 entry of HealthBotKeysResponse along with {@link Response}. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, - Context context); + PagedIterable list(); /** - * Regenerate the API JWT Secret of a HealthBot. + * Returns all the resources of a particular type belonging to a subscription. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param botName The name of the Bot resource. + * @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 entry of HealthBotKeysResponse. + * @return the list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. */ - HealthBotKey regenerateApiJwtSecret(String resourceGroupName, String botName); + PagedIterable list(Context context); /** - * Returns all the resources of a particular type belonging to a resource group. + * List all secrets of a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return health Bot Keys Response along with {@link Response}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + Response listSecretsWithResponse(String resourceGroupName, String botName, Context context); /** - * Returns all the resources of a particular type belonging to a resource group. + * List all secrets of a HealthBot. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return health Bot Keys Response. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + HealthBotKeysResponse listSecrets(String resourceGroupName, String botName); /** - * Returns all the resources of a particular type belonging to a subscription. + * Regenerate the API JWT Secret of a HealthBot. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. + * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return an entry of HealthBotKeysResponse along with {@link Response}. */ - PagedIterable list(); + Response regenerateApiJwtSecretWithResponse(String resourceGroupName, String botName, + Context context); /** - * Returns all the resources of a particular type belonging to a subscription. + * Regenerate the API JWT Secret of a HealthBot. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param botName The name of the Bot resource. * @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 list of Azure Health Bot operation response as paginated response with {@link PagedIterable}. + * @return an entry of HealthBotKeysResponse. */ - PagedIterable list(Context context); + HealthBotKey regenerateApiJwtSecret(String resourceGroupName, String botName); /** * Get a HealthBot. diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBot.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBot.java index 10d5cfc7eab4..cbbee588cff0 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBot.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBot.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; @@ -50,6 +50,13 @@ public interface HealthBot { */ Map tags(); + /** + * Gets the properties property: The set of properties specific to Azure Health Bot resource. + * + * @return the properties value. + */ + HealthBotProperties properties(); + /** * Gets the sku property: SKU of the Azure Health Bot. * @@ -65,14 +72,7 @@ public interface HealthBot { Identity identity(); /** - * Gets the properties property: The set of properties specific to Azure Health Bot resource. - * - * @return the properties value. - */ - HealthBotProperties properties(); - - /** - * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ @@ -151,7 +151,7 @@ interface WithResourceGroup { /** * Specifies resourceGroupName. * - * @param resourceGroupName The name of the Bot resource group in the user subscription. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithSku withExistingResourceGroup(String resourceGroupName); @@ -175,7 +175,7 @@ interface WithSku { * be created, but also allows for any other optional properties to be specified. */ interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithProperties { + extends DefinitionStages.WithTags, DefinitionStages.WithProperties, DefinitionStages.WithIdentity { /** * Executes the create request. * @@ -206,29 +206,29 @@ interface WithTags { } /** - * The stage of the HealthBot definition allowing to specify identity. + * The stage of the HealthBot definition allowing to specify properties. */ - interface WithIdentity { + interface WithProperties { /** - * Specifies the identity property: The identity of the Azure Health Bot.. + * Specifies the properties property: The set of properties specific to Azure Health Bot resource.. * - * @param identity The identity of the Azure Health Bot. + * @param properties The set of properties specific to Azure Health Bot resource. * @return the next definition stage. */ - WithCreate withIdentity(Identity identity); + WithCreate withProperties(HealthBotProperties properties); } /** - * The stage of the HealthBot definition allowing to specify properties. + * The stage of the HealthBot definition allowing to specify identity. */ - interface WithProperties { + interface WithIdentity { /** - * Specifies the properties property: The set of properties specific to Azure Health Bot resource.. + * Specifies the identity property: The identity of the Azure Health Bot.. * - * @param properties The set of properties specific to Azure Health Bot resource. + * @param identity The identity of the Azure Health Bot. * @return the next definition stage. */ - WithCreate withProperties(HealthBotProperties properties); + WithCreate withIdentity(Identity identity); } } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKey.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKey.java index 0b4efacdc4ec..798afe4fbb0b 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKey.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKey.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKeysResponse.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKeysResponse.java index 240722534efd..eab34beca5b3 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKeysResponse.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotKeysResponse.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotProperties.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotProperties.java index bf627845b0f9..5504984ece2b 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotProperties.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; @@ -12,8 +12,6 @@ import java.io.IOException; /** - * HealthBotProperties - * * The properties of a Azure Health Bot. The Health Bot Service is a cloud platform that empowers developers in * Healthcare organizations to build and deploy their compliant, AI-powered virtual health assistants and health bots, * that help them improve processes and reduce costs. @@ -93,17 +91,6 @@ public String accessControlMethod() { return this.accessControlMethod; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyVaultProperties() != null) { - keyVaultProperties().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotUpdateParameters.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotUpdateParameters.java index abde320c131e..cb8b320654f1 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotUpdateParameters.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/HealthBotUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; @@ -148,23 +148,6 @@ public HealthBotUpdateParameters withLocation(String location) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() != null) { - properties().validate(); - } - if (sku() != null) { - sku().validate(); - } - if (identity() != null) { - identity().validate(); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Identity.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Identity.java index 1de2a7925197..6f767a638016 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Identity.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/Identity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; @@ -115,21 +115,6 @@ public Identity withUserAssignedIdentities(Map use return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (userAssignedIdentities() != null) { - userAssignedIdentities().values().forEach(e -> { - if (e != null) { - e.validate(); - } - }); - } - } - /** * {@inheritDoc} */ diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/KeyVaultProperties.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/KeyVaultProperties.java index 8aeef2fd7a35..818ae7a357b4 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/KeyVaultProperties.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/KeyVaultProperties.java @@ -1,11 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -123,24 +122,6 @@ public KeyVaultProperties withUserIdentity(String userIdentity) { return this; } - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (keyName() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property keyName in model KeyVaultProperties")); - } - if (keyVaultUri() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property keyVaultUri in model KeyVaultProperties")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(KeyVaultProperties.class); - /** * {@inheritDoc} */ diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/OperationDetail.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/OperationDetail.java index f187c4cd5ab7..99ec1bac1ee7 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/OperationDetail.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/OperationDetail.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/OperationDisplay.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/OperationDisplay.java index 983a3a7000c7..a81bed1abe4b 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/OperationDisplay.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/main/java/com/azure/resourcemanager/healthbot/models/OperationDisplay.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Operation display payload. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* * Resource provider of the operation @@ -39,7 +39,7 @@ public final class OperationDisplay implements JsonSerializable Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.bots().delete("aozwyiftyhxhu", "okftyxolniwpwcuk", com.azure.core.util.Context.NONE); + manager.bots().delete("jbasvmsmjqulngs", "tnb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/IdentityTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/IdentityTests.java index a4c6ea55d358..33048c1c2d4e 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/IdentityTests.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/IdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.generated; @@ -16,7 +16,7 @@ public final class IdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Identity model = BinaryData.fromString( - "{\"principalId\":\"jnqglhqgnu\",\"tenantId\":\"oo\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"glzlhjxrifkwmrv\":{\"principalId\":\"qes\",\"clientId\":\"gdf\"},\"uajpsquc\":{\"principalId\":\"siznto\",\"clientId\":\"pa\"},\"knygjofjddeq\":{\"principalId\":\"o\",\"clientId\":\"dkfo\"},\"usarhmofc\":{\"principalId\":\"deupewnwrei\",\"clientId\":\"zyf\"}}}") + "{\"principalId\":\"s\",\"tenantId\":\"nyejhkryhtnap\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"nchgej\":{\"principalId\":\"jye\",\"clientId\":\"kvnipjoxz\"},\"wyahuxinpmqnja\":{\"principalId\":\"odmailzyd\",\"clientId\":\"o\"}}}") .toObject(Identity.class); Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.type()); } @@ -25,8 +25,7 @@ public void testDeserialize() throws Exception { public void testSerialize() throws Exception { Identity model = new Identity().withType(ResourceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities( - mapOf("glzlhjxrifkwmrv", new UserAssignedIdentity(), "uajpsquc", new UserAssignedIdentity(), - "knygjofjddeq", new UserAssignedIdentity(), "usarhmofc", new UserAssignedIdentity())); + mapOf("nchgej", new UserAssignedIdentity(), "wyahuxinpmqnja", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(Identity.class); Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.type()); } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDetailInnerTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDetailInnerTests.java index f6d4e7a8a8df..d2794b3285c8 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDetailInnerTests.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDetailInnerTests.java @@ -1,46 +1,25 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.generated; import com.azure.core.util.BinaryData; import com.azure.resourcemanager.healthbot.fluent.models.OperationDetailInner; -import com.azure.resourcemanager.healthbot.models.OperationDisplay; import org.junit.jupiter.api.Assertions; public final class OperationDetailInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDetailInner model = BinaryData.fromString( - "{\"name\":\"ngbwjz\",\"isDataAction\":true,\"display\":{\"provider\":\"xgispemvtzfkufu\",\"resource\":\"jofxqe\",\"operation\":\"jaeq\",\"description\":\"qjbasvms\"},\"origin\":\"qulngsntnbybkzgc\",\"properties\":\"datawclxxwrl\"}") + "{\"name\":\"kuksjtxukcdm\",\"isDataAction\":true,\"display\":{\"provider\":\"y\",\"resource\":\"nzwuxzd\",\"operation\":\"a\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"kknryrtihf\",\"properties\":\"dataijbpzvgnwzsymgl\"}") .toObject(OperationDetailInner.class); - Assertions.assertEquals("ngbwjz", model.name()); + Assertions.assertEquals("kuksjtxukcdm", model.name()); Assertions.assertTrue(model.isDataAction()); - Assertions.assertEquals("xgispemvtzfkufu", model.display().provider()); - Assertions.assertEquals("jofxqe", model.display().resource()); - Assertions.assertEquals("jaeq", model.display().operation()); - Assertions.assertEquals("qjbasvms", model.display().description()); - Assertions.assertEquals("qulngsntnbybkzgc", model.origin()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDetailInner model = new OperationDetailInner().withName("ngbwjz") - .withIsDataAction(true) - .withDisplay(new OperationDisplay().withProvider("xgispemvtzfkufu") - .withResource("jofxqe") - .withOperation("jaeq") - .withDescription("qjbasvms")) - .withOrigin("qulngsntnbybkzgc") - .withProperties("datawclxxwrl"); - model = BinaryData.fromObject(model).toObject(OperationDetailInner.class); - Assertions.assertEquals("ngbwjz", model.name()); - Assertions.assertTrue(model.isDataAction()); - Assertions.assertEquals("xgispemvtzfkufu", model.display().provider()); - Assertions.assertEquals("jofxqe", model.display().resource()); - Assertions.assertEquals("jaeq", model.display().operation()); - Assertions.assertEquals("qjbasvms", model.display().description()); - Assertions.assertEquals("qulngsntnbybkzgc", model.origin()); + Assertions.assertEquals("y", model.display().provider()); + Assertions.assertEquals("nzwuxzd", model.display().resource()); + Assertions.assertEquals("a", model.display().operation()); + Assertions.assertEquals("lhmwhfpmrqobm", model.display().description()); + Assertions.assertEquals("kknryrtihf", model.origin()); } } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDisplayTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDisplayTests.java index c379ba23ddfa..b9b4e22cc85a 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDisplayTests.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationDisplayTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.generated; @@ -11,25 +11,13 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"ouskcqvkocrc\",\"resource\":\"kwt\",\"operation\":\"xbnjbiksq\",\"description\":\"lssai\"}") + OperationDisplay model = BinaryData + .fromString( + "{\"provider\":\"fcyzkohdbihanufh\",\"resource\":\"bj\",\"operation\":\"a\",\"description\":\"th\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("ouskcqvkocrc", model.provider()); - Assertions.assertEquals("kwt", model.resource()); - Assertions.assertEquals("xbnjbiksq", model.operation()); - Assertions.assertEquals("lssai", model.description()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("ouskcqvkocrc") - .withResource("kwt") - .withOperation("xbnjbiksq") - .withDescription("lssai"); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("ouskcqvkocrc", model.provider()); - Assertions.assertEquals("kwt", model.resource()); - Assertions.assertEquals("xbnjbiksq", model.operation()); - Assertions.assertEquals("lssai", model.description()); + Assertions.assertEquals("fcyzkohdbihanufh", model.provider()); + Assertions.assertEquals("bj", model.resource()); + Assertions.assertEquals("a", model.operation()); + Assertions.assertEquals("th", model.description()); } } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationsListMockTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationsListMockTests.java index b3c59290a8d4..1b1ea6d3e13a 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationsListMockTests.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/OperationsListMockTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.generated; @@ -22,7 +22,7 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"u\",\"isDataAction\":true,\"display\":{\"provider\":\"khbzhfepgzg\",\"resource\":\"xzlocxscp\",\"operation\":\"erhhbcsglumm\",\"description\":\"tjaodxobnb\"},\"origin\":\"k\",\"properties\":\"dataxo\"}]}"; + = "{\"value\":[{\"name\":\"fsinzgvfcjrwzoxx\",\"isDataAction\":true,\"display\":{\"provider\":\"luwfzitonpeqfpjk\",\"resource\":\"xofpdvhpfxxypi\",\"operation\":\"nmayhuybb\",\"description\":\"odepoogin\"},\"origin\":\"amiheognarxz\",\"properties\":\"dataheotusiv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); @@ -33,12 +33,12 @@ public void testList() throws Exception { PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("u", response.iterator().next().name()); + Assertions.assertEquals("fsinzgvfcjrwzoxx", response.iterator().next().name()); Assertions.assertTrue(response.iterator().next().isDataAction()); - Assertions.assertEquals("khbzhfepgzg", response.iterator().next().display().provider()); - Assertions.assertEquals("xzlocxscp", response.iterator().next().display().resource()); - Assertions.assertEquals("erhhbcsglumm", response.iterator().next().display().operation()); - Assertions.assertEquals("tjaodxobnb", response.iterator().next().display().description()); - Assertions.assertEquals("k", response.iterator().next().origin()); + Assertions.assertEquals("luwfzitonpeqfpjk", response.iterator().next().display().provider()); + Assertions.assertEquals("xofpdvhpfxxypi", response.iterator().next().display().resource()); + Assertions.assertEquals("nmayhuybb", response.iterator().next().display().operation()); + Assertions.assertEquals("odepoogin", response.iterator().next().display().description()); + Assertions.assertEquals("amiheognarxz", response.iterator().next().origin()); } } diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/SkuTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/SkuTests.java index d39481f35c41..9e04e3c26c8e 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/SkuTests.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/SkuTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.generated; diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/UserAssignedIdentityTests.java b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/UserAssignedIdentityTests.java index fc83c335d317..e9a5438eb761 100644 --- a/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/UserAssignedIdentityTests.java +++ b/sdk/healthbot/azure-resourcemanager-healthbot/src/test/java/com/azure/resourcemanager/healthbot/generated/UserAssignedIdentityTests.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.healthbot.generated; @@ -10,8 +10,9 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString("{\"principalId\":\"smy\",\"clientId\":\"kdtmlxhekuk\"}") - .toObject(UserAssignedIdentity.class); + UserAssignedIdentity model + = BinaryData.fromString("{\"principalId\":\"ixjsprozvcputeg\",\"clientId\":\"wmfdatscmdvpjhul\"}") + .toObject(UserAssignedIdentity.class); } @org.junit.jupiter.api.Test diff --git a/sdk/healthbot/azure-resourcemanager-healthbot/tsp-location.yaml b/sdk/healthbot/azure-resourcemanager-healthbot/tsp-location.yaml new file mode 100644 index 000000000000..923f26107ca8 --- /dev/null +++ b/sdk/healthbot/azure-resourcemanager-healthbot/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/healthbot/HealthBot.Management +commit: 53d56e4ec74156c450d1e51745a971d3f2031dd7 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md index 2dd0a420e7db..15ece4ee2c48 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.2.0-beta.1 (Unreleased) +## 2.2.0-beta.1 (Unreleased) ### Features Added @@ -10,6 +10,220 @@ ### Other Changes +## 2.1.0 (2026-01-05) + +- Azure Resource Manager LogAnalytics client library for Java. This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2025-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Features Added + +#### `models.RuleDefinition` was modified + +* `withDestinationTable(java.lang.String)` was added + +## 2.0.0 (2025-12-22) + +- Azure Resource Manager LogAnalytics client library for Java. This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2025-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +#### `models.AzureResourceProperties` was removed + +#### `models.SystemDataAutoGenerated` was removed + +#### `models.CreatedByType` was removed + +#### `models.QueryPacksResource` was removed + +#### `models.Capacity` was removed + +#### `models.CapacityReservationLevel` was removed + +#### `models.CapacityReservationProperties` was modified + +* `java.lang.String lastSkuUpdate()` -> `java.time.OffsetDateTime lastSkuUpdate()` + +#### `models.WorkspacePatch` was modified + +* `java.lang.String createdDate()` -> `java.time.OffsetDateTime createdDate()` +* `java.lang.String modifiedDate()` -> `java.time.OffsetDateTime modifiedDate()` + +#### `models.Workspace` was modified + +* `java.lang.String modifiedDate()` -> `java.time.OffsetDateTime modifiedDate()` +* `models.SystemDataAutoGenerated systemData()` -> `com.azure.core.management.SystemData systemData()` +* `java.lang.String createdDate()` -> `java.time.OffsetDateTime createdDate()` + +#### `models.WorkspaceSku` was modified + +* `java.lang.String lastSkuUpdate()` -> `java.time.OffsetDateTime lastSkuUpdate()` +* `models.CapacityReservationLevel capacityReservationLevel()` -> `java.lang.Integer capacityReservationLevel()` +* `withCapacityReservationLevel(models.CapacityReservationLevel)` was removed + +#### `models.AssociatedWorkspace` was modified + +* `java.lang.String associateDate()` -> `java.time.OffsetDateTime associateDate()` +* `java.lang.String workspaceId()` -> `java.util.UUID workspaceId()` + +#### `models.Table` was modified + +* `models.SystemDataAutoGenerated systemData()` -> `com.azure.core.management.SystemData systemData()` + +#### `models.Cluster` was modified + +* `java.lang.String lastModifiedDate()` -> `java.time.OffsetDateTime lastModifiedDate()` +* `java.lang.String createdDate()` -> `java.time.OffsetDateTime createdDate()` + +#### `models.IdentityType` was modified + +* `IdentityType()` was removed +* `java.util.Collection values()` -> `models.IdentityType[] values()` + +#### `models.ClusterSku` was modified + +* `models.Capacity capacity()` -> `java.lang.Long capacity()` +* `withCapacity(models.Capacity)` was removed + +### Features Added + +* `models.SummaryLogs$DefinitionStages` was added + +* `models.WorkspaceReplicationProperties` was added + +* `models.AccessRulePropertiesSubscriptionsItem` was added + +* `models.WorkspaceFailoverProperties` was added + +* `models.SummaryLogs$Definition` was added + +* `models.SummaryLogsListResult` was added + +* `models.ProvisioningIssue` was added + +* `models.AccessRuleProperties` was added + +* `models.ClusterReplicationProperties` was added + +* `models.ClusterReplicationState` was added + +* `models.SummaryLogsOperations` was added + +* `models.NetworkSecurityPerimeterConfigurationListResult` was added + +* `models.AccessRule` was added + +* `models.RuleDefinition` was added + +* `models.NetworkSecurityPerimeter` was added + +* `models.ResourceAssociation` was added + +* `models.NetworkSecurityProfile` was added + +* `models.NetworkSecurityPerimeterConfigurationProperties` was added + +* `models.SummaryLogs$UpdateStages` was added + +* `models.IssueType` was added + +* `models.AccessRuleDirection` was added + +* `models.SummaryLogsRetryBin` was added + +* `models.ResourceAssociationAccessMode` was added + +* `models.Severity` was added + +* `models.StatusCodeEnum` was added + +* `models.NetworkSecurityPerimeterConfigurationProvisioningState` was added + +* `models.SummaryLogs$Update` was added + +* `models.ProvisioningIssueProperties` was added + +* `models.NetworkSecurityPerimeterConfiguration` was added + +* `models.WorkspaceReplicationState` was added + +* `models.RuleTypeEnum` was added + +* `models.SummaryLogsRetryBinProperties` was added + +* `models.SummaryLogs` was added + +* `models.TimeSelectorEnum` was added + +* `models.WorkspaceFailoverState` was added + +#### `models.Cluster$Definition` was modified + +* `withReplication(models.ClusterReplicationProperties)` was added + +#### `LogAnalyticsManager` was modified + +* `summaryLogsOperations()` was added + +#### `models.WorkspaceFeatures` was modified + +* `unifiedSentinelBillingOnly()` was added +* `associations()` was added + +#### `models.Workspace$Update` was modified + +* `withFailover(models.WorkspaceFailoverProperties)` was added +* `withReplication(models.WorkspaceReplicationProperties)` was added + +#### `models.Workspace$Definition` was modified + +* `withFailover(models.WorkspaceFailoverProperties)` was added +* `withReplication(models.WorkspaceReplicationProperties)` was added + +#### `models.WorkspacePatch` was modified + +* `failover()` was added +* `withReplication(models.WorkspaceReplicationProperties)` was added +* `replication()` was added +* `withFailover(models.WorkspaceFailoverProperties)` was added + +#### `models.Workspace` was modified + +* `replication()` was added +* `failover()` was added + +#### `models.LogAnalyticsQueryPack` was modified + +* `systemData()` was added + +#### `models.WorkspaceSku` was modified + +* `withCapacityReservationLevel(java.lang.Integer)` was added + +#### `models.Workspaces` was modified + +* `listNsp(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `getNsp(java.lang.String,java.lang.String,java.lang.String)` was added +* `failover(java.lang.String,java.lang.String,java.lang.String)` was added +* `failback(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `failover(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `reconcileNsp(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `failback(java.lang.String,java.lang.String)` was added +* `getNspWithResponse(java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added +* `reconcileNsp(java.lang.String,java.lang.String,java.lang.String)` was added +* `listNsp(java.lang.String,java.lang.String)` was added + +#### `models.Cluster` was modified + +* `replication()` was added + +#### `models.IdentityType` was modified + +* `valueOf(java.lang.String)` was added +* `toString()` was added + +#### `models.ClusterSku` was modified + +* `withCapacity(java.lang.Long)` was added + ## 1.1.0 (2024-12-13) - Azure Resource Manager LogAnalytics client library for Java. This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2022-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md index 0badc4533918..93f9f6139e3f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/README.md @@ -2,7 +2,7 @@ Azure Resource Manager LogAnalytics client library for Java. -This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2022-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for LogAnalytics Management SDK. Operational Insights Client. Package tag package-2025-07-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-loganalytics - 1.2.0-beta.1 + 2.1.0 ``` [//]: # ({x-version-update-end}) @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ LogAnalyticsManager manager = LogAnalyticsManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -107,5 +107,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md b/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md index 672f15ccedf6..794a73c07638 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/SAMPLE.md @@ -111,6 +111,16 @@ - [Get](#storageinsightconfigs_get) - [ListByWorkspace](#storageinsightconfigs_listbyworkspace) +## SummaryLogsOperation + +- [CreateOrUpdate](#summarylogsoperation_createorupdate) +- [Delete](#summarylogsoperation_delete) +- [Get](#summarylogsoperation_get) +- [ListByWorkspace](#summarylogsoperation_listbyworkspace) +- [RetryBin](#summarylogsoperation_retrybin) +- [Start](#summarylogsoperation_start) +- [Stop](#summarylogsoperation_stop) + ## Tables - [CancelSearch](#tables_cancelsearch) @@ -134,9 +144,14 @@ - [CreateOrUpdate](#workspaces_createorupdate) - [Delete](#workspaces_delete) +- [Failback](#workspaces_failback) +- [Failover](#workspaces_failover) - [GetByResourceGroup](#workspaces_getbyresourcegroup) +- [GetNsp](#workspaces_getnsp) - [List](#workspaces_list) - [ListByResourceGroup](#workspaces_listbyresourcegroup) +- [ListNsp](#workspaces_listnsp) +- [ReconcileNsp](#workspaces_reconcilensp) - [Update](#workspaces_update) ### AvailableServiceTiers_ListByWorkspace @@ -147,8 +162,8 @@ public final class AvailableServiceTiersListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesAvailableServiceTiers.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesAvailableServiceTiers.json */ /** * Sample code: AvailableServiceTiers. @@ -165,7 +180,6 @@ public final class AvailableServiceTiersListByWorkspaceSamples { ### Clusters_CreateOrUpdate ```java -import com.azure.resourcemanager.loganalytics.models.Capacity; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; import java.util.HashMap; @@ -177,8 +191,8 @@ import java.util.Map; public final class ClustersCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersCreate.json */ /** * Sample code: ClustersCreate. @@ -188,11 +202,10 @@ public final class ClustersCreateOrUpdateSamples { public static void clustersCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { manager.clusters() .define("oiautorest6685") - .withRegion("australiasoutheast") + .withRegion("eastus") .withExistingResourceGroup("oiautorest6685") .withTags(mapOf("tag1", "val1")) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withSku(new ClusterSku().withCapacity(100L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) .create(); } @@ -219,8 +232,8 @@ public final class ClustersCreateOrUpdateSamples { public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersDelete.json */ /** * Sample code: ClustersDelete. @@ -242,8 +255,8 @@ public final class ClustersDeleteSamples { public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersGet.json */ /** * Sample code: ClustersGet. @@ -266,8 +279,8 @@ public final class ClustersGetByResourceGroupSamples { public final class ClustersListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersSubscriptionList.json */ /** * Sample code: ClustersSubscriptionList. @@ -289,8 +302,8 @@ public final class ClustersListSamples { public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersListByResourceGroup.json */ /** * Sample code: ClustersGet. @@ -306,7 +319,6 @@ public final class ClustersListByResourceGroupSamples { ### Clusters_Update ```java -import com.azure.resourcemanager.loganalytics.models.Capacity; import com.azure.resourcemanager.loganalytics.models.Cluster; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; @@ -323,8 +335,8 @@ import java.util.Map; public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersUpdate.json */ /** * Sample code: ClustersPatch. @@ -341,8 +353,7 @@ public final class ClustersUpdateSamples { .withUserAssignedIdentities(mapOf( "/subscriptions/53bc36c5-91e1-4d09-92c9-63b89e571926/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", new UserAssignedIdentity()))) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withSku(new ClusterSku().withCapacity(1000L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) .withKeyVaultProperties(new KeyVaultProperties().withKeyVaultUri("fakeTokenPlaceholder") .withKeyName("fakeTokenPlaceholder") .withKeyVersion("fakeTokenPlaceholder") @@ -375,8 +386,8 @@ import java.util.Arrays; public final class DataExportsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportCreateOrUpdate.json */ /** * Sample code: DataExportCreate. @@ -404,8 +415,8 @@ public final class DataExportsCreateOrUpdateSamples { public final class DataExportsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportDelete.json */ /** * Sample code: DataExportDelete. @@ -428,8 +439,8 @@ public final class DataExportsDeleteSamples { public final class DataExportsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportGet.json */ /** * Sample code: DataExportGet. @@ -451,8 +462,8 @@ public final class DataExportsGetSamples { public final class DataExportsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportListByWorkspace.json */ /** * Sample code: DataExportGet. @@ -479,8 +490,8 @@ import java.io.IOException; public final class DataSourcesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesCreate.json */ /** * Sample code: DataSourcesCreate. @@ -511,8 +522,8 @@ public final class DataSourcesCreateOrUpdateSamples { public final class DataSourcesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesDelete.json */ /** * Sample code: DataSourcesDelete. @@ -535,8 +546,8 @@ public final class DataSourcesDeleteSamples { public final class DataSourcesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesGet.json */ /** * Sample code: DataSourcesGet. @@ -559,8 +570,8 @@ public final class DataSourcesGetSamples { public final class DataSourcesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesListByWorkspace.json */ /** * Sample code: DataSourcesListByWorkspace. @@ -584,8 +595,8 @@ public final class DataSourcesListByWorkspaceSamples { public final class DeletedWorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSubscriptionList.json */ /** * Sample code: WorkspacesSubscriptionList. @@ -607,8 +618,8 @@ public final class DeletedWorkspacesListSamples { public final class DeletedWorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListByResourceGroup.json */ /** * Sample code: WorkspacesGet. @@ -630,8 +641,8 @@ public final class DeletedWorkspacesListByResourceGroupSamples { public final class GatewaysDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesGatewaysDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGatewaysDelete.json */ /** * Sample code: DeleteGateways. @@ -655,8 +666,8 @@ public final class GatewaysDeleteSamples { public final class IntelligencePacksDisableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDisableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDisableIntelligencePack.json */ /** * Sample code: IntelligencePacksDisable. @@ -679,8 +690,8 @@ public final class IntelligencePacksDisableSamples { public final class IntelligencePacksEnableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesEnableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesEnableIntelligencePack.json */ /** * Sample code: IntelligencePacksEnable. @@ -703,8 +714,8 @@ public final class IntelligencePacksEnableSamples { public final class IntelligencePacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListIntelligencePacks.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListIntelligencePacks.json */ /** * Sample code: IntelligencePacksList. @@ -726,8 +737,8 @@ public final class IntelligencePacksListSamples { public final class LinkedServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesCreate.json */ /** * Sample code: LinkedServicesCreate. @@ -754,8 +765,8 @@ public final class LinkedServicesCreateOrUpdateSamples { public final class LinkedServicesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesDelete.json */ /** * Sample code: LinkedServicesDelete. @@ -777,8 +788,8 @@ public final class LinkedServicesDeleteSamples { public final class LinkedServicesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesGet.json */ /** * Sample code: LinkedServicesGet. @@ -800,8 +811,8 @@ public final class LinkedServicesGetSamples { public final class LinkedServicesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesListByWorkspace.json */ /** * Sample code: LinkedServicesListByWorkspace. @@ -827,8 +838,8 @@ import java.util.Arrays; public final class LinkedStorageAccountsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsCreate.json */ /** * Sample code: LinkedStorageAccountsCreate. @@ -858,8 +869,8 @@ import com.azure.resourcemanager.loganalytics.models.DataSourceType; public final class LinkedStorageAccountsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsDelete.json */ /** * Sample code: LinkedStorageAccountsDelete. @@ -885,8 +896,8 @@ import com.azure.resourcemanager.loganalytics.models.DataSourceType; public final class LinkedStorageAccountsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsGet.json */ /** * Sample code: LinkedStorageAccountsGet. @@ -910,8 +921,8 @@ public final class LinkedStorageAccountsGetSamples { public final class LinkedStorageAccountsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsListByWorkspace.json */ /** * Sample code: Gets list of linked storage accounts on a workspace. @@ -935,8 +946,8 @@ public final class LinkedStorageAccountsListByWorkspaceSamples { public final class ManagementGroupsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListManagementGroups.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListManagementGroups.json */ /** * Sample code: WorkspacesListManagementGroups. @@ -959,8 +970,8 @@ public final class ManagementGroupsListSamples { public final class OperationStatusesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * OperationStatusesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/OperationStatusesGet.json */ /** * Sample code: Get specific operation status. @@ -983,8 +994,8 @@ public final class OperationStatusesGetSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * OperationsListByTenant.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/OperationsListByTenant.json */ /** * Sample code: Get specific operation status. @@ -1006,8 +1017,8 @@ public final class OperationsListSamples { public final class QueriesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesDelete.json */ /** * Sample code: QueryDelete. @@ -1031,8 +1042,8 @@ public final class QueriesDeleteSamples { public final class QueriesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesGet.json */ /** * Sample code: QueryGet. @@ -1056,8 +1067,8 @@ public final class QueriesGetSamples { public final class QueriesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesList.json */ /** * Sample code: QueryList. @@ -1084,8 +1095,8 @@ import java.util.Map; public final class QueriesPutSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesPut.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesPut.json */ /** * Sample code: QueryPut. @@ -1134,8 +1145,8 @@ import java.util.Map; public final class QueriesSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesSearch.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesSearch.json */ /** * Sample code: QuerySearch. @@ -1181,8 +1192,8 @@ import java.util.Map; public final class QueriesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesUpdate.json */ /** * Sample code: QueryPatch. @@ -1230,8 +1241,8 @@ import java.util.Map; public final class QueryPacksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksCreate.json */ /** * Sample code: QueryPackCreate. @@ -1248,8 +1259,8 @@ public final class QueryPacksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksUpdate.json */ /** * Sample code: QueryPackUpdate. @@ -1292,8 +1303,8 @@ import java.util.Map; public final class QueryPacksCreateOrUpdateWithoutNameSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksCreateNoName.json */ /** * Sample code: QueryPackCreateNoName. @@ -1308,8 +1319,8 @@ public final class QueryPacksCreateOrUpdateWithoutNameSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackUpdateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackUpdateNoName.json */ /** * Sample code: QueryPackUpdateNoName. @@ -1346,8 +1357,8 @@ public final class QueryPacksCreateOrUpdateWithoutNameSamples { public final class QueryPacksDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksDelete.json */ /** * Sample code: QueryPacksDelete. @@ -1370,8 +1381,8 @@ public final class QueryPacksDeleteSamples { public final class QueryPacksGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksGet.json */ /** * Sample code: QueryPackGet. @@ -1394,8 +1405,8 @@ public final class QueryPacksGetByResourceGroupSamples { public final class QueryPacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksList.json */ /** * Sample code: QueryPacksList. @@ -1417,8 +1428,8 @@ public final class QueryPacksListSamples { public final class QueryPacksListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksListByResourceGroup.json */ /** * Sample code: QueryPackListByResourceGroup. @@ -1445,8 +1456,8 @@ import java.util.Map; public final class QueryPacksUpdateTagsSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdateTagsOnly.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksUpdateTagsOnly.json */ /** * Sample code: QueryPackUpdateTagsOnly. @@ -1486,8 +1497,8 @@ import java.util.Arrays; public final class SavedSearchesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSavedSearchesCreateOrUpdate.json */ /** * Sample code: SavedSearchCreateOrUpdate. @@ -1519,8 +1530,8 @@ public final class SavedSearchesCreateOrUpdateSamples { public final class SavedSearchesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDeleteSavedSearches.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDeleteSavedSearches.json */ /** * Sample code: SavedSearchesDelete. @@ -1544,8 +1555,8 @@ public final class SavedSearchesDeleteSamples { public final class SavedSearchesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSavedSearchesGet.json */ /** * Sample code: SavedSearchesGet. @@ -1569,8 +1580,8 @@ public final class SavedSearchesGetSamples { public final class SavedSearchesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SavedSearchesListByWorkspace.json */ /** * Sample code: SavedSearchesList. @@ -1592,8 +1603,8 @@ public final class SavedSearchesListByWorkspaceSamples { public final class SchemaGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesGetSchema.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SavedSearchesGetSchema.json */ /** * Sample code: WorkspacesGetSchema. @@ -1615,8 +1626,8 @@ public final class SchemaGetSamples { public final class SharedKeysOperationGetSharedKeysSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesGetSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGetSharedKeys.json */ /** * Sample code: SharedKeysList. @@ -1638,8 +1649,8 @@ public final class SharedKeysOperationGetSharedKeysSamples { public final class SharedKeysOperationRegenerateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesRegenerateSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesRegenerateSharedKeys.json */ /** * Sample code: RegenerateSharedKeys. @@ -1664,8 +1675,8 @@ import java.util.Arrays; public final class StorageInsightConfigsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsCreateOrUpdate.json */ /** * Sample code: StorageInsightsCreate. @@ -1695,8 +1706,8 @@ public final class StorageInsightConfigsCreateOrUpdateSamples { public final class StorageInsightConfigsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsDelete.json */ /** * Sample code: StorageInsightsDelete. @@ -1719,8 +1730,8 @@ public final class StorageInsightConfigsDeleteSamples { public final class StorageInsightConfigsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsGet.json */ /** * Sample code: StorageInsightsGet. @@ -1743,8 +1754,8 @@ public final class StorageInsightConfigsGetSamples { public final class StorageInsightConfigsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsListByWorkspace.json */ /** * Sample code: StorageInsightsList. @@ -1758,6 +1769,193 @@ public final class StorageInsightConfigsListByWorkspaceSamples { } ``` +### SummaryLogsOperation_CreateOrUpdate + +```java +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import java.time.OffsetDateTime; + +/** + * Samples for SummaryLogsOperation CreateOrUpdate. + */ +public final class SummaryLogsOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsUpsert.json + */ + /** + * Sample code: SummaryLogsUpsert. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsUpsert(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .define("summarylogs1") + .withExistingWorkspace("oiautorest6685", "oiautorest6685") + .withRuleType(RuleTypeEnum.USER) + .withRuleDefinition(new RuleDefinition().withQuery("MyTable_CL") + .withBinSize(180) + .withBinDelay(10) + .withBinStartTime(OffsetDateTime.parse("2020-02-03T04:05:06Z")) + .withDestinationTable("MyDestinationTable_CL")) + .create(); + } +} +``` + +### SummaryLogsOperation_Delete + +```java +/** + * Samples for SummaryLogsOperation Delete. + */ +public final class SummaryLogsOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsDelete.json + */ + /** + * Sample code: SummaryLogsDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .delete("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_Get + +```java +/** + * Samples for SummaryLogsOperation Get. + */ +public final class SummaryLogsOperationGetSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsGet.json + */ + /** + * Sample code: SummaryLogsGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .getWithResponse("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_ListByWorkspace + +```java +/** + * Samples for SummaryLogsOperation ListByWorkspace. + */ +public final class SummaryLogsOperationListByWorkspaceSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsList.json + */ + /** + * Sample code: SummaryLogsListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .listByWorkspace("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_RetryBin + +```java +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBinProperties; +import java.time.OffsetDateTime; + +/** + * Samples for SummaryLogsOperation RetryBin. + */ +public final class SummaryLogsOperationRetryBinSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsRetryBin.json + */ + /** + * Sample code: SummaryLogsRetryBin. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsRetryBin(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .retryBin("oiautorest6685", "oiautorest6685", "summarylogs1", + new SummaryLogsRetryBin().withProperties(new SummaryLogsRetryBinProperties() + .withRetryBinStartTime(OffsetDateTime.parse("2020-02-03T04:00:00Z"))), + com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_Start + +```java +/** + * Samples for SummaryLogsOperation Start. + */ +public final class SummaryLogsOperationStartSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsStart.json + */ + /** + * Sample code: SummaryLogsStart. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsStart(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .start("exampleresourcegroup", "exampleworkspace", "summarylogs3", com.azure.core.util.Context.NONE); + } +} +``` + +### SummaryLogsOperation_Stop + +```java +/** + * Samples for SummaryLogsOperation Stop. + */ +public final class SummaryLogsOperationStopSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsStop.json + */ + /** + * Sample code: SummaryLogsStop. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsStop(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .stopWithResponse("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} +``` + ### Tables_CancelSearch ```java @@ -1767,8 +1965,8 @@ public final class StorageInsightConfigsListByWorkspaceSamples { public final class TablesCancelSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesSearchCancel.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesSearchCancel.json */ /** * Sample code: TablesSearchCancel. @@ -1797,8 +1995,8 @@ import java.util.Arrays; public final class TablesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesUpsert.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesUpsert.json */ /** * Sample code: TablesUpsert. @@ -1827,8 +2025,8 @@ public final class TablesCreateOrUpdateSamples { public final class TablesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesDelete.json */ /** * Sample code: TablesDelete. @@ -1850,8 +2048,8 @@ public final class TablesDeleteSamples { public final class TablesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesGet.json */ /** * Sample code: TablesGet. @@ -1874,8 +2072,8 @@ public final class TablesGetSamples { public final class TablesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesList.json */ /** * Sample code: TablesListByWorkspace. @@ -1897,8 +2095,8 @@ public final class TablesListByWorkspaceSamples { public final class TablesMigrateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesMigrate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesMigrate.json */ /** * Sample code: TablesMigrate. @@ -1927,8 +2125,8 @@ import java.util.Arrays; public final class TablesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesUpsert.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesUpsert.json */ /** * Sample code: TablesUpsert. @@ -1958,8 +2156,8 @@ public final class TablesUpdateSamples { public final class UsagesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListUsages.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListUsages.json */ /** * Sample code: UsagesList. @@ -1981,8 +2179,8 @@ public final class UsagesListSamples { public final class WorkspacePurgeGetPurgeStatusSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeOperation.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurgeOperation.json */ /** * Sample code: WorkspacePurgeOperation. @@ -2010,8 +2208,8 @@ import java.util.Arrays; public final class WorkspacePurgePurgeSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeResourceId.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurgeResourceId.json */ /** * Sample code: WorkspacePurgeResourceId. @@ -2030,8 +2228,8 @@ public final class WorkspacePurgePurgeSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurge.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurge.json */ /** * Sample code: WorkspacePurge. @@ -2064,8 +2262,8 @@ import java.util.Map; public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesCreate.json */ /** * Sample code: WorkspacesCreate. @@ -2106,8 +2304,8 @@ public final class WorkspacesCreateOrUpdateSamples { public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDelete.json */ /** * Sample code: WorkspacesDelete. @@ -2120,6 +2318,52 @@ public final class WorkspacesDeleteSamples { } ``` +### Workspaces_Failback + +```java +/** + * Samples for Workspaces Failback. + */ +public final class WorkspacesFailbackSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesFailback.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failback("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_Failover + +```java +/** + * Samples for Workspaces Failover. + */ +public final class WorkspacesFailoverSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesFailover.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failover("oiautorest6685", "eastus", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} +``` + ### Workspaces_GetByResourceGroup ```java @@ -2129,8 +2373,8 @@ public final class WorkspacesDeleteSamples { public final class WorkspacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGet.json */ /** * Sample code: WorkspaceGet. @@ -2144,6 +2388,32 @@ public final class WorkspacesGetByResourceGroupSamples { } ``` +### Workspaces_GetNsp + +```java +/** + * Samples for Workspaces GetNsp. + */ +public final class WorkspacesGetNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_Get.json + */ + /** + * Sample code: Get NSP config by name for Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + getNSPConfigByNameForScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .getNspWithResponse("exampleRG", "someWorkspace", "somePerimeterConfiguration", + com.azure.core.util.Context.NONE); + } +} +``` + ### Workspaces_List ```java @@ -2153,8 +2423,8 @@ public final class WorkspacesGetByResourceGroupSamples { public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSubscriptionList.json */ /** * Sample code: WorkspacesSubscriptionList. @@ -2176,8 +2446,8 @@ public final class WorkspacesListSamples { public final class WorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListByResourceGroup.json */ /** * Sample code: WorkspacesGet. @@ -2190,6 +2460,55 @@ public final class WorkspacesListByResourceGroupSamples { } ``` +### Workspaces_ListNsp + +```java +/** + * Samples for Workspaces ListNsp. + */ +public final class WorkspacesListNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_List.json + */ + /** + * Sample code: List NSP configs by Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + listNSPConfigsByScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().listNsp("exampleRG", "someWorkspace", com.azure.core.util.Context.NONE); + } +} +``` + +### Workspaces_ReconcileNsp + +```java +/** + * Samples for Workspaces ReconcileNsp. + */ +public final class WorkspacesReconcileNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_Reconcile.json + */ + /** + * Sample code: Reconcile NSP config for Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + reconcileNSPConfigForScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .reconcileNsp("exampleRG", "someWorkspace", "somePerimeterConfiguration", com.azure.core.util.Context.NONE); + } +} +``` + ### Workspaces_Update ```java @@ -2204,8 +2523,8 @@ import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; public final class WorkspacesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesUpdate.json */ /** * Sample code: WorkspacesPatch. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml index eb5b604f5d24..c65a79733b28 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-loganalytics - 1.2.0-beta.1 + 2.2.0-beta.1 jar Microsoft Azure SDK for LogAnalytics Management - This package contains Microsoft Azure SDK for LogAnalytics Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Operational Insights Client. Package tag package-2022-10. + This package contains Microsoft Azure SDK for LogAnalytics Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Operational Insights Client. Package tag package-2025-07-01. https://github.com/Azure/azure-sdk-for-java @@ -45,8 +45,6 @@ UTF-8 0 0 - false - true diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java index d6bdc947ef43..67e3a361ae94 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/LogAnalyticsManager.java @@ -22,6 +22,7 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.OperationalInsightsManagementClient; import com.azure.resourcemanager.loganalytics.implementation.AvailableServiceTiersImpl; @@ -43,6 +44,7 @@ import com.azure.resourcemanager.loganalytics.implementation.SchemasImpl; import com.azure.resourcemanager.loganalytics.implementation.SharedKeysOperationsImpl; import com.azure.resourcemanager.loganalytics.implementation.StorageInsightConfigsImpl; +import com.azure.resourcemanager.loganalytics.implementation.SummaryLogsOperationsImpl; import com.azure.resourcemanager.loganalytics.implementation.TablesImpl; import com.azure.resourcemanager.loganalytics.implementation.UsagesImpl; import com.azure.resourcemanager.loganalytics.implementation.WorkspacePurgesImpl; @@ -65,6 +67,7 @@ import com.azure.resourcemanager.loganalytics.models.Schemas; import com.azure.resourcemanager.loganalytics.models.SharedKeysOperations; import com.azure.resourcemanager.loganalytics.models.StorageInsightConfigs; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsOperations; import com.azure.resourcemanager.loganalytics.models.Tables; import com.azure.resourcemanager.loganalytics.models.Usages; import com.azure.resourcemanager.loganalytics.models.WorkspacePurges; @@ -73,6 +76,7 @@ import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -81,14 +85,16 @@ * Operational Insights Client. */ public final class LogAnalyticsManager { - private QueryPacks queryPacks; + private AvailableServiceTiers availableServiceTiers; - private Queries queries; + private Clusters clusters; private DataExports dataExports; private DataSources dataSources; + private Gateways gateways; + private IntelligencePacks intelligencePacks; private LinkedServices linkedServices; @@ -97,33 +103,33 @@ public final class LogAnalyticsManager { private ManagementGroups managementGroups; - private OperationStatuses operationStatuses; + private Operations operations; - private SharedKeysOperations sharedKeysOperations; + private OperationStatuses operationStatuses; - private Usages usages; + private Queries queries; - private StorageInsightConfigs storageInsightConfigs; + private QueryPacks queryPacks; private SavedSearches savedSearches; - private AvailableServiceTiers availableServiceTiers; + private Schemas schemas; - private Gateways gateways; + private SharedKeysOperations sharedKeysOperations; - private Schemas schemas; + private StorageInsightConfigs storageInsightConfigs; - private WorkspacePurges workspacePurges; + private Tables tables; - private Clusters clusters; + private Usages usages; - private Operations operations; + private WorkspacePurges workspacePurges; private Workspaces workspaces; private DeletedWorkspaces deletedWorkspaces; - private Tables tables; + private SummaryLogsOperations summaryLogsOperations; private final OperationalInsightsManagementClient clientObject; @@ -177,6 +183,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-loganalytics.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -284,12 +293,14 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.loganalytics") .append("/") - .append("1.1.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -336,27 +347,27 @@ public LogAnalyticsManager authenticate(TokenCredential credential, AzureProfile } /** - * Gets the resource collection API of QueryPacks. It manages LogAnalyticsQueryPack. + * Gets the resource collection API of AvailableServiceTiers. * - * @return Resource collection API of QueryPacks. + * @return Resource collection API of AvailableServiceTiers. */ - public QueryPacks queryPacks() { - if (this.queryPacks == null) { - this.queryPacks = new QueryPacksImpl(clientObject.getQueryPacks(), this); + public AvailableServiceTiers availableServiceTiers() { + if (this.availableServiceTiers == null) { + this.availableServiceTiers = new AvailableServiceTiersImpl(clientObject.getAvailableServiceTiers(), this); } - return queryPacks; + return availableServiceTiers; } /** - * Gets the resource collection API of Queries. It manages LogAnalyticsQueryPackQuery. + * Gets the resource collection API of Clusters. It manages Cluster. * - * @return Resource collection API of Queries. + * @return Resource collection API of Clusters. */ - public Queries queries() { - if (this.queries == null) { - this.queries = new QueriesImpl(clientObject.getQueries(), this); + public Clusters clusters() { + if (this.clusters == null) { + this.clusters = new ClustersImpl(clientObject.getClusters(), this); } - return queries; + return clusters; } /** @@ -383,6 +394,18 @@ public DataSources dataSources() { return dataSources; } + /** + * Gets the resource collection API of Gateways. + * + * @return Resource collection API of Gateways. + */ + public Gateways gateways() { + if (this.gateways == null) { + this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + } + return gateways; + } + /** * Gets the resource collection API of IntelligencePacks. * @@ -432,51 +455,51 @@ public ManagementGroups managementGroups() { } /** - * Gets the resource collection API of OperationStatuses. + * Gets the resource collection API of Operations. * - * @return Resource collection API of OperationStatuses. + * @return Resource collection API of Operations. */ - public OperationStatuses operationStatuses() { - if (this.operationStatuses == null) { - this.operationStatuses = new OperationStatusesImpl(clientObject.getOperationStatuses(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return operationStatuses; + return operations; } /** - * Gets the resource collection API of SharedKeysOperations. + * Gets the resource collection API of OperationStatuses. * - * @return Resource collection API of SharedKeysOperations. + * @return Resource collection API of OperationStatuses. */ - public SharedKeysOperations sharedKeysOperations() { - if (this.sharedKeysOperations == null) { - this.sharedKeysOperations = new SharedKeysOperationsImpl(clientObject.getSharedKeysOperations(), this); + public OperationStatuses operationStatuses() { + if (this.operationStatuses == null) { + this.operationStatuses = new OperationStatusesImpl(clientObject.getOperationStatuses(), this); } - return sharedKeysOperations; + return operationStatuses; } /** - * Gets the resource collection API of Usages. + * Gets the resource collection API of Queries. It manages LogAnalyticsQueryPackQuery. * - * @return Resource collection API of Usages. + * @return Resource collection API of Queries. */ - public Usages usages() { - if (this.usages == null) { - this.usages = new UsagesImpl(clientObject.getUsages(), this); + public Queries queries() { + if (this.queries == null) { + this.queries = new QueriesImpl(clientObject.getQueries(), this); } - return usages; + return queries; } /** - * Gets the resource collection API of StorageInsightConfigs. It manages StorageInsight. + * Gets the resource collection API of QueryPacks. It manages LogAnalyticsQueryPack. * - * @return Resource collection API of StorageInsightConfigs. + * @return Resource collection API of QueryPacks. */ - public StorageInsightConfigs storageInsightConfigs() { - if (this.storageInsightConfigs == null) { - this.storageInsightConfigs = new StorageInsightConfigsImpl(clientObject.getStorageInsightConfigs(), this); + public QueryPacks queryPacks() { + if (this.queryPacks == null) { + this.queryPacks = new QueryPacksImpl(clientObject.getQueryPacks(), this); } - return storageInsightConfigs; + return queryPacks; } /** @@ -492,75 +515,75 @@ public SavedSearches savedSearches() { } /** - * Gets the resource collection API of AvailableServiceTiers. + * Gets the resource collection API of Schemas. * - * @return Resource collection API of AvailableServiceTiers. + * @return Resource collection API of Schemas. */ - public AvailableServiceTiers availableServiceTiers() { - if (this.availableServiceTiers == null) { - this.availableServiceTiers = new AvailableServiceTiersImpl(clientObject.getAvailableServiceTiers(), this); + public Schemas schemas() { + if (this.schemas == null) { + this.schemas = new SchemasImpl(clientObject.getSchemas(), this); } - return availableServiceTiers; + return schemas; } /** - * Gets the resource collection API of Gateways. + * Gets the resource collection API of SharedKeysOperations. * - * @return Resource collection API of Gateways. + * @return Resource collection API of SharedKeysOperations. */ - public Gateways gateways() { - if (this.gateways == null) { - this.gateways = new GatewaysImpl(clientObject.getGateways(), this); + public SharedKeysOperations sharedKeysOperations() { + if (this.sharedKeysOperations == null) { + this.sharedKeysOperations = new SharedKeysOperationsImpl(clientObject.getSharedKeysOperations(), this); } - return gateways; + return sharedKeysOperations; } /** - * Gets the resource collection API of Schemas. + * Gets the resource collection API of StorageInsightConfigs. It manages StorageInsight. * - * @return Resource collection API of Schemas. + * @return Resource collection API of StorageInsightConfigs. */ - public Schemas schemas() { - if (this.schemas == null) { - this.schemas = new SchemasImpl(clientObject.getSchemas(), this); + public StorageInsightConfigs storageInsightConfigs() { + if (this.storageInsightConfigs == null) { + this.storageInsightConfigs = new StorageInsightConfigsImpl(clientObject.getStorageInsightConfigs(), this); } - return schemas; + return storageInsightConfigs; } /** - * Gets the resource collection API of WorkspacePurges. + * Gets the resource collection API of Tables. It manages Table. * - * @return Resource collection API of WorkspacePurges. + * @return Resource collection API of Tables. */ - public WorkspacePurges workspacePurges() { - if (this.workspacePurges == null) { - this.workspacePurges = new WorkspacePurgesImpl(clientObject.getWorkspacePurges(), this); + public Tables tables() { + if (this.tables == null) { + this.tables = new TablesImpl(clientObject.getTables(), this); } - return workspacePurges; + return tables; } /** - * Gets the resource collection API of Clusters. It manages Cluster. + * Gets the resource collection API of Usages. * - * @return Resource collection API of Clusters. + * @return Resource collection API of Usages. */ - public Clusters clusters() { - if (this.clusters == null) { - this.clusters = new ClustersImpl(clientObject.getClusters(), this); + public Usages usages() { + if (this.usages == null) { + this.usages = new UsagesImpl(clientObject.getUsages(), this); } - return clusters; + return usages; } /** - * Gets the resource collection API of Operations. + * Gets the resource collection API of WorkspacePurges. * - * @return Resource collection API of Operations. + * @return Resource collection API of WorkspacePurges. */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); + public WorkspacePurges workspacePurges() { + if (this.workspacePurges == null) { + this.workspacePurges = new WorkspacePurgesImpl(clientObject.getWorkspacePurges(), this); } - return operations; + return workspacePurges; } /** @@ -588,15 +611,15 @@ public DeletedWorkspaces deletedWorkspaces() { } /** - * Gets the resource collection API of Tables. It manages Table. + * Gets the resource collection API of SummaryLogsOperations. It manages SummaryLogs. * - * @return Resource collection API of Tables. + * @return Resource collection API of SummaryLogsOperations. */ - public Tables tables() { - if (this.tables == null) { - this.tables = new TablesImpl(clientObject.getTables(), this); + public SummaryLogsOperations summaryLogsOperations() { + if (this.summaryLogsOperations == null) { + this.summaryLogsOperations = new SummaryLogsOperationsImpl(clientObject.getSummaryLogsOperations(), this); } - return tables; + return summaryLogsOperations; } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java index 76c429b02fe3..876719a127c7 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/OperationalInsightsManagementClient.java @@ -25,6 +25,13 @@ public interface OperationalInsightsManagementClient { */ String getEndpoint(); + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + /** * Gets The HTTP pipeline to send requests through. * @@ -40,18 +47,18 @@ public interface OperationalInsightsManagementClient { Duration getDefaultPollInterval(); /** - * Gets the QueryPacksClient object to access its operations. + * Gets the AvailableServiceTiersClient object to access its operations. * - * @return the QueryPacksClient object. + * @return the AvailableServiceTiersClient object. */ - QueryPacksClient getQueryPacks(); + AvailableServiceTiersClient getAvailableServiceTiers(); /** - * Gets the QueriesClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the QueriesClient object. + * @return the ClustersClient object. */ - QueriesClient getQueries(); + ClustersClient getClusters(); /** * Gets the DataExportsClient object to access its operations. @@ -67,6 +74,13 @@ public interface OperationalInsightsManagementClient { */ DataSourcesClient getDataSources(); + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + GatewaysClient getGateways(); + /** * Gets the IntelligencePacksClient object to access its operations. * @@ -96,32 +110,32 @@ public interface OperationalInsightsManagementClient { ManagementGroupsClient getManagementGroups(); /** - * Gets the OperationStatusesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the OperationStatusesClient object. + * @return the OperationsClient object. */ - OperationStatusesClient getOperationStatuses(); + OperationsClient getOperations(); /** - * Gets the SharedKeysOperationsClient object to access its operations. + * Gets the OperationStatusesClient object to access its operations. * - * @return the SharedKeysOperationsClient object. + * @return the OperationStatusesClient object. */ - SharedKeysOperationsClient getSharedKeysOperations(); + OperationStatusesClient getOperationStatuses(); /** - * Gets the UsagesClient object to access its operations. + * Gets the QueriesClient object to access its operations. * - * @return the UsagesClient object. + * @return the QueriesClient object. */ - UsagesClient getUsages(); + QueriesClient getQueries(); /** - * Gets the StorageInsightConfigsClient object to access its operations. + * Gets the QueryPacksClient object to access its operations. * - * @return the StorageInsightConfigsClient object. + * @return the QueryPacksClient object. */ - StorageInsightConfigsClient getStorageInsightConfigs(); + QueryPacksClient getQueryPacks(); /** * Gets the SavedSearchesClient object to access its operations. @@ -131,46 +145,46 @@ public interface OperationalInsightsManagementClient { SavedSearchesClient getSavedSearches(); /** - * Gets the AvailableServiceTiersClient object to access its operations. + * Gets the SchemasClient object to access its operations. * - * @return the AvailableServiceTiersClient object. + * @return the SchemasClient object. */ - AvailableServiceTiersClient getAvailableServiceTiers(); + SchemasClient getSchemas(); /** - * Gets the GatewaysClient object to access its operations. + * Gets the SharedKeysOperationsClient object to access its operations. * - * @return the GatewaysClient object. + * @return the SharedKeysOperationsClient object. */ - GatewaysClient getGateways(); + SharedKeysOperationsClient getSharedKeysOperations(); /** - * Gets the SchemasClient object to access its operations. + * Gets the StorageInsightConfigsClient object to access its operations. * - * @return the SchemasClient object. + * @return the StorageInsightConfigsClient object. */ - SchemasClient getSchemas(); + StorageInsightConfigsClient getStorageInsightConfigs(); /** - * Gets the WorkspacePurgesClient object to access its operations. + * Gets the TablesClient object to access its operations. * - * @return the WorkspacePurgesClient object. + * @return the TablesClient object. */ - WorkspacePurgesClient getWorkspacePurges(); + TablesClient getTables(); /** - * Gets the ClustersClient object to access its operations. + * Gets the UsagesClient object to access its operations. * - * @return the ClustersClient object. + * @return the UsagesClient object. */ - ClustersClient getClusters(); + UsagesClient getUsages(); /** - * Gets the OperationsClient object to access its operations. + * Gets the WorkspacePurgesClient object to access its operations. * - * @return the OperationsClient object. + * @return the WorkspacePurgesClient object. */ - OperationsClient getOperations(); + WorkspacePurgesClient getWorkspacePurges(); /** * Gets the WorkspacesClient object to access its operations. @@ -187,9 +201,9 @@ public interface OperationalInsightsManagementClient { DeletedWorkspacesClient getDeletedWorkspaces(); /** - * Gets the TablesClient object to access its operations. + * Gets the SummaryLogsOperationsClient object to access its operations. * - * @return the TablesClient object. + * @return the SummaryLogsOperationsClient object. */ - TablesClient getTables(); + SummaryLogsOperationsClient getSummaryLogsOperations(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/SummaryLogsOperationsClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/SummaryLogsOperationsClient.java new file mode 100644 index 000000000000..e00c3ef2b116 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/SummaryLogsOperationsClient.java @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.loganalytics.fluent.models.SummaryLogsInner; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; + +/** + * An instance of this class provides access to all the operations defined in SummaryLogsOperationsClient. + */ +public interface SummaryLogsOperationsClient { + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SummaryLogsInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner parameters); + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, SummaryLogsInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner parameters, Context context); + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SummaryLogsInner createOrUpdate(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsInner parameters); + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SummaryLogsInner createOrUpdate(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsInner parameters, Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + SummaryLogsInner get(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginDelete(String resourceGroupName, String workspaceName, + String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginDelete(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 delete(String resourceGroupName, String workspaceName, String summaryLogsName, Context context); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginStart(String resourceGroupName, String workspaceName, + String summaryLogsName); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginStart(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 start(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 start(String resourceGroupName, String workspaceName, String summaryLogsName, Context context); + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 stopWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context); + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 stop(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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> beginRetryBin(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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> beginRetryBin(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters, Context context); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters, Context context); +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java index 9762af2104eb..03ec9dd954ce 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/WorkspacesClient.java @@ -11,6 +11,7 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; @@ -248,4 +249,259 @@ Response updateWithResponse(String resourceGroupName, String wor */ @ServiceMethod(returns = ReturnType.SINGLE) WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch parameters); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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> beginFailover(String resourceGroupName, String location, String workspaceName); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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> beginFailover(String resourceGroupName, String location, String workspaceName, + Context context); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failover(String resourceGroupName, String location, String workspaceName); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failover(String resourceGroupName, String location, String workspaceName, Context context); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> beginFailback(String resourceGroupName, String workspaceName); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> beginFailback(String resourceGroupName, String workspaceName, Context context); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failback(String resourceGroupName, String workspaceName); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failback(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listNsp(String resourceGroupName, String workspaceName); + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listNsp(String resourceGroupName, String workspaceName, + Context context); + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getNspWithResponse(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityPerimeterConfigurationInner getNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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> beginReconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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> beginReconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 reconcileNsp(String resourceGroupName, String workspaceName, String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 reconcileNsp(String resourceGroupName, String workspaceName, String networkSecurityPerimeterConfigurationName, + Context context); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java index dca539d1283f..695778d797e5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterInner.java @@ -13,10 +13,12 @@ import com.azure.resourcemanager.loganalytics.models.BillingType; import com.azure.resourcemanager.loganalytics.models.CapacityReservationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentity; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -279,7 +281,7 @@ public ClusterInner withKeyVaultProperties(KeyVaultProperties keyVaultProperties * * @return the lastModifiedDate value. */ - public String lastModifiedDate() { + public OffsetDateTime lastModifiedDate() { return this.innerProperties() == null ? null : this.innerProperties().lastModifiedDate(); } @@ -288,7 +290,7 @@ public String lastModifiedDate() { * * @return the createdDate value. */ - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } @@ -338,6 +340,29 @@ public ClusterInner withCapacityReservationProperties(CapacityReservationPropert return this; } + /** + * Get the replication property: Cluster's replication properties. + * + * @return the replication value. + */ + public ClusterReplicationProperties replication() { + return this.innerProperties() == null ? null : this.innerProperties().replication(); + } + + /** + * Set the replication property: Cluster's replication properties. + * + * @param replication the replication value to set. + * @return the ClusterInner object itself. + */ + public ClusterInner withReplication(ClusterReplicationProperties replication) { + if (this.innerProperties() == null) { + this.innerProperties = new ClusterProperties(); + } + this.innerProperties().withReplication(replication); + return this; + } + /** * Validates the instance. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java index 4e19d868af64..4e83811ad839 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/ClusterProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.fluent.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; @@ -13,8 +14,10 @@ import com.azure.resourcemanager.loganalytics.models.BillingType; import com.azure.resourcemanager.loganalytics.models.CapacityReservationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; /** @@ -58,12 +61,12 @@ public final class ClusterProperties implements JsonSerializable writer.writeJson(element)); jsonWriter.writeJsonField("capacityReservationProperties", this.capacityReservationProperties); + jsonWriter.writeJsonField("replication", this.replication); return jsonWriter.writeEndObject(); } @@ -308,9 +340,11 @@ public static ClusterProperties fromJson(JsonReader jsonReader) throws IOExcepti } else if ("keyVaultProperties".equals(fieldName)) { deserializedClusterProperties.keyVaultProperties = KeyVaultProperties.fromJson(reader); } else if ("lastModifiedDate".equals(fieldName)) { - deserializedClusterProperties.lastModifiedDate = reader.getString(); + deserializedClusterProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("createdDate".equals(fieldName)) { - deserializedClusterProperties.createdDate = reader.getString(); + deserializedClusterProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("associatedWorkspaces".equals(fieldName)) { List associatedWorkspaces = reader.readArray(reader1 -> AssociatedWorkspace.fromJson(reader1)); @@ -318,6 +352,8 @@ public static ClusterProperties fromJson(JsonReader jsonReader) throws IOExcepti } else if ("capacityReservationProperties".equals(fieldName)) { deserializedClusterProperties.capacityReservationProperties = CapacityReservationProperties.fromJson(reader); + } else if ("replication".equals(fieldName)) { + deserializedClusterProperties.replication = ClusterReplicationProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java index e5fc73ff7755..855631fc4208 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackInner.java @@ -5,11 +5,12 @@ package com.azure.resourcemanager.loganalytics.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.loganalytics.models.QueryPacksResource; import java.io.IOException; import java.time.OffsetDateTime; import java.util.Map; @@ -18,12 +19,17 @@ * An Log Analytics QueryPack definition. */ @Fluent -public final class LogAnalyticsQueryPackInner extends QueryPacksResource { +public final class LogAnalyticsQueryPackInner extends Resource { /* * Properties that define a Log Analytics QueryPack resource. */ private LogAnalyticsQueryPackProperties innerProperties = new LogAnalyticsQueryPackProperties(); + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -54,6 +60,15 @@ private LogAnalyticsQueryPackProperties innerProperties() { return this.innerProperties; } + /** + * 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. * @@ -145,7 +160,6 @@ public String provisioningState() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() == null) { throw LOGGER.atError() @@ -200,6 +214,8 @@ public static LogAnalyticsQueryPackInner fromJson(JsonReader jsonReader) throws } else if ("properties".equals(fieldName)) { deserializedLogAnalyticsQueryPackInner.innerProperties = LogAnalyticsQueryPackProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogAnalyticsQueryPackInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java index 2d3af3ceef01..baf421ce5d1b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryInner.java @@ -5,11 +5,11 @@ package com.azure.resourcemanager.loganalytics.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.loganalytics.models.AzureResourceProperties; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryPropertiesRelated; import java.io.IOException; import java.time.OffsetDateTime; @@ -20,29 +20,29 @@ * A Log Analytics QueryPack-Query definition. */ @Fluent -public final class LogAnalyticsQueryPackQueryInner extends AzureResourceProperties { +public final class LogAnalyticsQueryPackQueryInner extends ProxyResource { /* * Properties that define an Log Analytics QueryPack-Query resource. */ private LogAnalyticsQueryPackQueryProperties innerProperties; /* - * Read only system data + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; /* - * Azure resource type + * The type of the resource. */ private String type; /* - * Azure resource name + * The name of the resource. */ private String name; /* - * Azure resource Id + * Fully qualified resource Id for the resource. */ private String id; @@ -62,17 +62,16 @@ private LogAnalyticsQueryPackQueryProperties innerProperties() { } /** - * Get the systemData property: Read only system data. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ - @Override public SystemData systemData() { return this.systemData; } /** - * Get the type property: Azure resource type. + * Get the type property: The type of the resource. * * @return the type value. */ @@ -82,7 +81,7 @@ public String type() { } /** - * Get the name property: Azure resource name. + * Get the name property: The name of the resource. * * @return the name value. */ @@ -92,7 +91,7 @@ public String name() { } /** - * Get the id property: Azure resource Id. + * Get the id property: Fully qualified resource Id for the resource. * * @return the id value. */ @@ -280,7 +279,6 @@ public LogAnalyticsQueryPackQueryInner withProperties(Object properties) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -303,6 +301,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of LogAnalyticsQueryPackQueryInner 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 LogAnalyticsQueryPackQueryInner. */ public static LogAnalyticsQueryPackQueryInner fromJson(JsonReader jsonReader) throws IOException { @@ -319,11 +318,11 @@ public static LogAnalyticsQueryPackQueryInner fromJson(JsonReader jsonReader) th deserializedLogAnalyticsQueryPackQueryInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedLogAnalyticsQueryPackQueryInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedLogAnalyticsQueryPackQueryInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedLogAnalyticsQueryPackQueryInner.innerProperties = LogAnalyticsQueryPackQueryProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLogAnalyticsQueryPackQueryInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryProperties.java index ef7f75297643..81de1a33625d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/LogAnalyticsQueryPackQueryProperties.java @@ -270,7 +270,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("related", this.related); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeArray(element, (writer1, element1) -> writer1.writeString(element1))); - jsonWriter.writeUntypedField("properties", this.properties); + if (this.properties != null) { + jsonWriter.writeUntypedField("properties", this.properties); + } return jsonWriter.writeEndObject(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/NetworkSecurityPerimeterConfigurationInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/NetworkSecurityPerimeterConfigurationInner.java new file mode 100644 index 000000000000..737dec497890 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/NetworkSecurityPerimeterConfigurationInner.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; +import java.io.IOException; + +/** + * Network security perimeter (NSP) configuration resource. + */ +@Fluent +public final class NetworkSecurityPerimeterConfigurationInner extends ProxyResource { + /* + * Network security configuration properties. + */ + private NetworkSecurityPerimeterConfigurationProperties 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 NetworkSecurityPerimeterConfigurationInner class. + */ + public NetworkSecurityPerimeterConfigurationInner() { + } + + /** + * Get the properties property: Network security configuration properties. + * + * @return the properties value. + */ + public NetworkSecurityPerimeterConfigurationProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Network security configuration properties. + * + * @param properties the properties value to set. + * @return the NetworkSecurityPerimeterConfigurationInner object itself. + */ + public NetworkSecurityPerimeterConfigurationInner + withProperties(NetworkSecurityPerimeterConfigurationProperties 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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationInner 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 NetworkSecurityPerimeterConfigurationInner. + */ + public static NetworkSecurityPerimeterConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationInner deserializedNetworkSecurityPerimeterConfigurationInner + = new NetworkSecurityPerimeterConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.properties + = NetworkSecurityPerimeterConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationInner; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsInner.java new file mode 100644 index 000000000000..dac9c5b8294c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsInner.java @@ -0,0 +1,279 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.loganalytics.models.ProvisioningStateEnum; +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import com.azure.resourcemanager.loganalytics.models.StatusCodeEnum; +import java.io.IOException; + +/** + * Workspace data summary rules definition. + */ +@Fluent +public final class SummaryLogsInner extends ProxyResource { + /* + * Summary rule properties. + */ + private SummaryLogsProperties innerProperties; + + /* + * 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 SummaryLogsInner class. + */ + public SummaryLogsInner() { + } + + /** + * Get the innerProperties property: Summary rule properties. + * + * @return the innerProperties value. + */ + private SummaryLogsProperties innerProperties() { + return this.innerProperties; + } + + /** + * 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; + } + + /** + * Get the ruleType property: SummaryRules rule type: User. + * + * @return the ruleType value. + */ + public RuleTypeEnum ruleType() { + return this.innerProperties() == null ? null : this.innerProperties().ruleType(); + } + + /** + * Set the ruleType property: SummaryRules rule type: User. + * + * @param ruleType the ruleType value to set. + * @return the SummaryLogsInner object itself. + */ + public SummaryLogsInner withRuleType(RuleTypeEnum ruleType) { + if (this.innerProperties() == null) { + this.innerProperties = new SummaryLogsProperties(); + } + this.innerProperties().withRuleType(ruleType); + return this; + } + + /** + * Get the displayName property: The display name of the Summary rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.innerProperties() == null ? null : this.innerProperties().displayName(); + } + + /** + * Set the displayName property: The display name of the Summary rule. + * + * @param displayName the displayName value to set. + * @return the SummaryLogsInner object itself. + */ + public SummaryLogsInner withDisplayName(String displayName) { + if (this.innerProperties() == null) { + this.innerProperties = new SummaryLogsProperties(); + } + this.innerProperties().withDisplayName(displayName); + return this; + } + + /** + * Get the description property: The description of the Summary rule. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: The description of the Summary rule. + * + * @param description the description value to set. + * @return the SummaryLogsInner object itself. + */ + public SummaryLogsInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new SummaryLogsProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the isActive property: Indicates if Summary rule is active. If not, Summary rule execution stops. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.innerProperties() == null ? null : this.innerProperties().isActive(); + } + + /** + * Get the statusCode property: Indicates the reason for rule deactivation. + * + * @return the statusCode value. + */ + public StatusCodeEnum statusCode() { + return this.innerProperties() == null ? null : this.innerProperties().statusCode(); + } + + /** + * Get the provisioningState property: Summary rule is in provisioning state. If set to 'updating' or 'deleting', + * indicates a resource lock due to an ongoing operation, preventing any update to the Summary rule until the + * operation is complete. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the ruleDefinition property: Rule definition parameters. + * + * @return the ruleDefinition value. + */ + public RuleDefinition ruleDefinition() { + return this.innerProperties() == null ? null : this.innerProperties().ruleDefinition(); + } + + /** + * Set the ruleDefinition property: Rule definition parameters. + * + * @param ruleDefinition the ruleDefinition value to set. + * @return the SummaryLogsInner object itself. + */ + public SummaryLogsInner withRuleDefinition(RuleDefinition ruleDefinition) { + if (this.innerProperties() == null) { + this.innerProperties = new SummaryLogsProperties(); + } + this.innerProperties().withRuleDefinition(ruleDefinition); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryLogsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryLogsInner 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 SummaryLogsInner. + */ + public static SummaryLogsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryLogsInner deserializedSummaryLogsInner = new SummaryLogsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSummaryLogsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSummaryLogsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSummaryLogsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSummaryLogsInner.innerProperties = SummaryLogsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSummaryLogsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryLogsInner; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsProperties.java new file mode 100644 index 000000000000..0f151e746cdb --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/SummaryLogsProperties.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.fluent.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 com.azure.resourcemanager.loganalytics.models.ProvisioningStateEnum; +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import com.azure.resourcemanager.loganalytics.models.StatusCodeEnum; +import java.io.IOException; + +/** + * Summary rule properties. + */ +@Fluent +public final class SummaryLogsProperties implements JsonSerializable { + /* + * SummaryRules rule type: User. + */ + private RuleTypeEnum ruleType; + + /* + * The display name of the Summary rule. + */ + private String displayName; + + /* + * The description of the Summary rule. + */ + private String description; + + /* + * Indicates if Summary rule is active. If not, Summary rule execution stops. + */ + private Boolean isActive; + + /* + * Indicates the reason for rule deactivation. + */ + private StatusCodeEnum statusCode; + + /* + * Summary rule is in provisioning state. If set to 'updating' or 'deleting', indicates a resource lock due to an + * ongoing operation, preventing any update to the Summary rule until the operation is complete. + */ + private ProvisioningStateEnum provisioningState; + + /* + * Rule definition parameters. + */ + private RuleDefinition ruleDefinition; + + /** + * Creates an instance of SummaryLogsProperties class. + */ + public SummaryLogsProperties() { + } + + /** + * Get the ruleType property: SummaryRules rule type: User. + * + * @return the ruleType value. + */ + public RuleTypeEnum ruleType() { + return this.ruleType; + } + + /** + * Set the ruleType property: SummaryRules rule type: User. + * + * @param ruleType the ruleType value to set. + * @return the SummaryLogsProperties object itself. + */ + public SummaryLogsProperties withRuleType(RuleTypeEnum ruleType) { + this.ruleType = ruleType; + return this; + } + + /** + * Get the displayName property: The display name of the Summary rule. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the Summary rule. + * + * @param displayName the displayName value to set. + * @return the SummaryLogsProperties object itself. + */ + public SummaryLogsProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the description property: The description of the Summary rule. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: The description of the Summary rule. + * + * @param description the description value to set. + * @return the SummaryLogsProperties object itself. + */ + public SummaryLogsProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the isActive property: Indicates if Summary rule is active. If not, Summary rule execution stops. + * + * @return the isActive value. + */ + public Boolean isActive() { + return this.isActive; + } + + /** + * Get the statusCode property: Indicates the reason for rule deactivation. + * + * @return the statusCode value. + */ + public StatusCodeEnum statusCode() { + return this.statusCode; + } + + /** + * Get the provisioningState property: Summary rule is in provisioning state. If set to 'updating' or 'deleting', + * indicates a resource lock due to an ongoing operation, preventing any update to the Summary rule until the + * operation is complete. + * + * @return the provisioningState value. + */ + public ProvisioningStateEnum provisioningState() { + return this.provisioningState; + } + + /** + * Get the ruleDefinition property: Rule definition parameters. + * + * @return the ruleDefinition value. + */ + public RuleDefinition ruleDefinition() { + return this.ruleDefinition; + } + + /** + * Set the ruleDefinition property: Rule definition parameters. + * + * @param ruleDefinition the ruleDefinition value to set. + * @return the SummaryLogsProperties object itself. + */ + public SummaryLogsProperties withRuleDefinition(RuleDefinition ruleDefinition) { + this.ruleDefinition = ruleDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (ruleDefinition() != null) { + ruleDefinition().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ruleType", this.ruleType == null ? null : this.ruleType.toString()); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("ruleDefinition", this.ruleDefinition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryLogsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryLogsProperties 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 SummaryLogsProperties. + */ + public static SummaryLogsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryLogsProperties deserializedSummaryLogsProperties = new SummaryLogsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ruleType".equals(fieldName)) { + deserializedSummaryLogsProperties.ruleType = RuleTypeEnum.fromString(reader.getString()); + } else if ("displayName".equals(fieldName)) { + deserializedSummaryLogsProperties.displayName = reader.getString(); + } else if ("description".equals(fieldName)) { + deserializedSummaryLogsProperties.description = reader.getString(); + } else if ("isActive".equals(fieldName)) { + deserializedSummaryLogsProperties.isActive = reader.getNullable(JsonReader::getBoolean); + } else if ("statusCode".equals(fieldName)) { + deserializedSummaryLogsProperties.statusCode = StatusCodeEnum.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedSummaryLogsProperties.provisioningState + = ProvisioningStateEnum.fromString(reader.getString()); + } else if ("ruleDefinition".equals(fieldName)) { + deserializedSummaryLogsProperties.ruleDefinition = RuleDefinition.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryLogsProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java index 4923dec7fdff..f9163289ea32 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableInner.java @@ -6,6 +6,7 @@ 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; @@ -14,7 +15,6 @@ import com.azure.resourcemanager.loganalytics.models.ResultStatistics; import com.azure.resourcemanager.loganalytics.models.Schema; import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; import java.io.IOException; @@ -31,7 +31,7 @@ public final class TableInner extends ProxyResource { /* * Metadata pertaining to creation and last modification of the resource. */ - private SystemDataAutoGenerated systemData; + private SystemData systemData; /* * The type of the resource. @@ -68,7 +68,7 @@ private TableProperties innerProperties() { * * @return the systemData value. */ - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.systemData; } @@ -103,8 +103,9 @@ public String id() { } /** - * Get the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Get the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @return the retentionInDays value. */ @@ -113,8 +114,9 @@ public Integer retentionInDays() { } /** - * Set the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Set the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @param retentionInDays the retentionInDays value to set. * @return the TableInner object itself. @@ -129,7 +131,7 @@ public TableInner withRetentionInDays(Integer retentionInDays) { /** * Get the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @return the totalRetentionInDays value. */ @@ -139,7 +141,7 @@ public Integer totalRetentionInDays() { /** * Set the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @param totalRetentionInDays the totalRetentionInDays value to set. * @return the TableInner object itself. @@ -153,7 +155,7 @@ public TableInner withTotalRetentionInDays(Integer totalRetentionInDays) { } /** - * Get the archiveRetentionInDays property: The table data archive retention in days. Calculated as + * Get the archiveRetentionInDays property: The tables long-term retention in days. Calculated as * (totalRetentionInDays-retentionInDays). * * @return the archiveRetentionInDays value. @@ -312,9 +314,6 @@ public void validate() { if (innerProperties() != null) { innerProperties().validate(); } - if (systemData() != null) { - systemData().validate(); - } } /** @@ -352,7 +351,7 @@ public static TableInner fromJson(JsonReader jsonReader) throws IOException { } else if ("properties".equals(fieldName)) { deserializedTableInner.innerProperties = TableProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedTableInner.systemData = SystemDataAutoGenerated.fromJson(reader); + deserializedTableInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableProperties.java index 224a110120ed..f3c825511b70 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/TableProperties.java @@ -23,19 +23,19 @@ @Fluent public final class TableProperties implements JsonSerializable { /* - * The table retention in days, between 4 and 730. Setting this property to -1 will default to the workspace - * retention. + * In Analytics table: the tables analytics retention in days, between 4 and 730. Setting this property to -1 will + * default to the workspace retention. In Basic and Auxiliary table: read only property. */ private Integer retentionInDays; /* - * The table total retention in days, between 4 and 4383. Setting this property to -1 will default to table - * retention. + * The table total retention in days, between 4 and 4383. Setting this property to -1 will default to + * retentionInDays. */ private Integer totalRetentionInDays; /* - * The table data archive retention in days. Calculated as (totalRetentionInDays-retentionInDays) + * The tables long-term retention in days. Calculated as (totalRetentionInDays-retentionInDays). */ private Integer archiveRetentionInDays; @@ -92,8 +92,9 @@ public TableProperties() { } /** - * Get the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Get the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @return the retentionInDays value. */ @@ -102,8 +103,9 @@ public Integer retentionInDays() { } /** - * Set the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Set the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @param retentionInDays the retentionInDays value to set. * @return the TableProperties object itself. @@ -115,7 +117,7 @@ public TableProperties withRetentionInDays(Integer retentionInDays) { /** * Get the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @return the totalRetentionInDays value. */ @@ -125,7 +127,7 @@ public Integer totalRetentionInDays() { /** * Set the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @param totalRetentionInDays the totalRetentionInDays value to set. * @return the TableProperties object itself. @@ -136,7 +138,7 @@ public TableProperties withTotalRetentionInDays(Integer totalRetentionInDays) { } /** - * Get the archiveRetentionInDays property: The table data archive retention in days. Calculated as + * Get the archiveRetentionInDays property: The tables long-term retention in days. Calculated as * (totalRetentionInDays-retentionInDays). * * @return the archiveRetentionInDays value. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java index 629b221fc494..65c697daf679 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceInner.java @@ -6,18 +6,21 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +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.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.PrivateLinkScopedResource; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; import com.azure.resourcemanager.loganalytics.models.WorkspaceEntityStatus; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -39,7 +42,7 @@ public final class WorkspaceInner extends Resource { /* * Metadata pertaining to creation and last modification of the resource. */ - private SystemDataAutoGenerated systemData; + private SystemData systemData; /* * The etag of the workspace. @@ -101,7 +104,7 @@ public WorkspaceInner withIdentity(Identity identity) { * * @return the systemData value. */ - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.systemData; } @@ -267,7 +270,7 @@ public WorkspaceInner withWorkspaceCapping(WorkspaceCapping workspaceCapping) { * * @return the createdDate value. */ - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } @@ -276,7 +279,7 @@ public String createdDate() { * * @return the modifiedDate value. */ - public String modifiedDate() { + public OffsetDateTime modifiedDate() { return this.innerProperties() == null ? null : this.innerProperties().modifiedDate(); } @@ -408,6 +411,52 @@ public WorkspaceInner withDefaultDataCollectionRuleResourceId(String defaultData return this; } + /** + * Get the replication property: workspace replication properties. + * + * @return the replication value. + */ + public WorkspaceReplicationProperties replication() { + return this.innerProperties() == null ? null : this.innerProperties().replication(); + } + + /** + * Set the replication property: workspace replication properties. + * + * @param replication the replication value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withReplication(WorkspaceReplicationProperties replication) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withReplication(replication); + return this; + } + + /** + * Get the failover property: workspace failover properties. + * + * @return the failover value. + */ + public WorkspaceFailoverProperties failover() { + return this.innerProperties() == null ? null : this.innerProperties().failover(); + } + + /** + * Set the failover property: workspace failover properties. + * + * @param failover the failover value to set. + * @return the WorkspaceInner object itself. + */ + public WorkspaceInner withFailover(WorkspaceFailoverProperties failover) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withFailover(failover); + return this; + } + /** * Validates the instance. * @@ -420,9 +469,6 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (systemData() != null) { - systemData().validate(); - } } /** @@ -471,7 +517,7 @@ public static WorkspaceInner fromJson(JsonReader jsonReader) throws IOException } else if ("identity".equals(fieldName)) { deserializedWorkspaceInner.identity = Identity.fromJson(reader); } else if ("systemData".equals(fieldName)) { - deserializedWorkspaceInner.systemData = SystemDataAutoGenerated.fromJson(reader); + deserializedWorkspaceInner.systemData = SystemData.fromJson(reader); } else if ("etag".equals(fieldName)) { deserializedWorkspaceInner.etag = reader.getString(); } else { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java index 53c89225a8c1..a951ec0ccf06 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/fluent/models/WorkspaceProperties.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.fluent.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; @@ -13,9 +14,12 @@ import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; import com.azure.resourcemanager.loganalytics.models.WorkspaceEntityStatus; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; /** @@ -52,12 +56,12 @@ public final class WorkspaceProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("modifiedDate".equals(fieldName)) { - deserializedWorkspaceProperties.modifiedDate = reader.getString(); + deserializedWorkspaceProperties.modifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("publicNetworkAccessForIngestion".equals(fieldName)) { deserializedWorkspaceProperties.publicNetworkAccessForIngestion = PublicNetworkAccessType.fromString(reader.getString()); @@ -394,6 +458,10 @@ public static WorkspaceProperties fromJson(JsonReader jsonReader) throws IOExcep deserializedWorkspaceProperties.features = WorkspaceFeatures.fromJson(reader); } else if ("defaultDataCollectionRuleResourceId".equals(fieldName)) { deserializedWorkspaceProperties.defaultDataCollectionRuleResourceId = reader.getString(); + } else if ("replication".equals(fieldName)) { + deserializedWorkspaceProperties.replication = WorkspaceReplicationProperties.fromJson(reader); + } else if ("failover".equals(fieldName)) { + deserializedWorkspaceProperties.failover = WorkspaceFailoverProperties.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java index bf7d14fc433d..79cc76334190 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/AvailableServiceTiersClientImpl.java @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.AvailableServiceTiersClient; import com.azure.resourcemanager.loganalytics.fluent.models.AvailableServiceTierInner; import java.util.List; @@ -56,7 +57,7 @@ public final class AvailableServiceTiersClientImpl implements AvailableServiceTi * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientAvailableServiceTiers") public interface AvailableServiceTiersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers") @@ -66,6 +67,15 @@ Mono>> listByWorkspace(@HostParam("$hos @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response> listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** @@ -97,51 +107,13 @@ private Mono>> listByWorkspaceWithRespo if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the available service tiers for the workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @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 available service tiers for the workspace along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listByWorkspaceWithResponseAsync(String resourceGroupName, - String workspaceName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context); - } - /** * Gets the available service tiers for the workspace. * @@ -172,7 +144,27 @@ private Mono> listByWorkspaceAsync(String resour @ServiceMethod(returns = ReturnType.SINGLE) public Response> listByWorkspaceWithResponse(String resourceGroupName, String workspaceName, Context context) { - return listByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context); } /** @@ -189,4 +181,6 @@ public Response> listByWorkspaceWithResponse(Str public List listByWorkspace(String resourceGroupName, String workspaceName) { return listByWorkspaceWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(AvailableServiceTiersClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java index d8419d40e0e5..39cc9a799e6f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClusterImpl.java @@ -13,9 +13,11 @@ import com.azure.resourcemanager.loganalytics.models.Cluster; import com.azure.resourcemanager.loganalytics.models.ClusterEntityStatus; import com.azure.resourcemanager.loganalytics.models.ClusterPatch; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.KeyVaultProperties; import com.azure.resourcemanager.loganalytics.models.ManagedServiceIdentity; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; import java.util.Map; @@ -82,11 +84,11 @@ public KeyVaultProperties keyVaultProperties() { return this.innerModel().keyVaultProperties(); } - public String lastModifiedDate() { + public OffsetDateTime lastModifiedDate() { return this.innerModel().lastModifiedDate(); } - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerModel().createdDate(); } @@ -103,6 +105,10 @@ public CapacityReservationProperties capacityReservationProperties() { return this.innerModel().capacityReservationProperties(); } + public ClusterReplicationProperties replication() { + return this.innerModel().replication(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -276,7 +282,12 @@ public ClusterImpl withCapacityReservationProperties(CapacityReservationProperti return this; } + public ClusterImpl withReplication(ClusterReplicationProperties replication) { + this.innerModel().withReplication(replication); + return this; + } + private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClustersClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClustersClientImpl.java index 019b3c86f818..bd4e395d2728 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClustersClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ClustersClientImpl.java @@ -28,8 +28,10 @@ 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.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.loganalytics.fluent.ClustersClient; @@ -69,7 +71,7 @@ public final class ClustersClientImpl implements ClustersClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientClusters") public interface ClustersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters") @@ -79,6 +81,14 @@ Mono> listByResourceGroup(@HostParam("$host") String @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @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.OperationalInsights/clusters") @ExpectedResponses({ 200 }) @@ -87,9 +97,17 @@ Mono> list(@HostParam("$host") 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.OperationalInsights/clusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") - @ExpectedResponses({ 200, 201, 202 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> createOrUpdate(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @@ -97,6 +115,16 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") ClusterInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("clusterName") String clusterName, + @BodyParam("application/json") ClusterInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") @ExpectedResponses({ 200, 202, 204 }) @@ -106,6 +134,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") @ExpectedResponses({ 200 }) @@ -116,15 +153,34 @@ Mono> getByResourceGroup(@HostParam("$host") String endpo @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") ClusterPatch parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/clusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") ClusterPatch parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -133,12 +189,27 @@ Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @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("$host") 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("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -165,11 +236,10 @@ private Mono> listByResourceGroupSinglePageAsync(Str return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + 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())); @@ -179,36 +249,15 @@ private Mono> listByResourceGroupSinglePageAsync(Str * Gets Log Analytics clusters in a resource group. * * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return log Analytics clusters in a resource group along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return log Analytics clusters in a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** @@ -218,12 +267,29 @@ private Mono> listByResourceGroupSinglePageAsync(Str * @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 log Analytics clusters in a resource group as paginated response with {@link PagedFlux}. + * @return log Analytics clusters in a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, + 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); } /** @@ -234,12 +300,29 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam * @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 log Analytics clusters in a resource group as paginated response with {@link PagedFlux}. + * @return log Analytics clusters in a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -253,7 +336,8 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -268,7 +352,8 @@ public PagedIterable listByResourceGroup(String resourceGroupName) */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -289,11 +374,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(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())); @@ -302,29 +386,13 @@ private Mono> listSinglePageAsync() { /** * Gets the Log Analytics clusters in a 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 Log Analytics clusters in a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the Log Analytics clusters in a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -332,11 +400,25 @@ private Mono> listSinglePageAsync(Context context) { * * @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 Log Analytics clusters in a subscription as paginated response with {@link PagedFlux}. + * @return the Log Analytics clusters in a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(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); } /** @@ -346,12 +428,25 @@ private PagedFlux listAsync() { * @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 Log Analytics clusters in a subscription as paginated response with {@link PagedFlux}. + * @return the Log Analytics clusters in a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(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); } /** @@ -363,7 +458,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -377,7 +472,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -415,11 +510,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), clusterName, parameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), clusterName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -429,41 +523,41 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Log Analytics cluster. * @param parameters The parameters required to create or update a Log Analytics cluster. - * @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 top level Log Analytics cluster resource container along with {@link Response} on successful - * completion of {@link Mono}. + * @return the top level Log Analytics cluster resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String clusterName, ClusterInner parameters, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + ClusterInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), clusterName, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), clusterName, parameters, accept, Context.NONE); } /** @@ -472,18 +566,42 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Log Analytics cluster. * @param parameters The parameters required to create or update a Log Analytics cluster. + * @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 PollerFlux} for polling of the top level Log Analytics cluster resource container. + * @return the top level Log Analytics cluster resource container along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, - String clusterName, ClusterInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String clusterName, + ClusterInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), clusterName, parameters, accept, context); } /** @@ -492,7 +610,6 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName The name of the Log Analytics cluster. * @param parameters The parameters required to create or update a Log Analytics cluster. - * @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. @@ -500,12 +617,11 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginCreateOrUpdateAsync(String resourceGroupName, - String clusterName, ClusterInner parameters, Context context) { - context = this.client.mergeContext(context); + String clusterName, ClusterInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); + ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -522,7 +638,9 @@ private PollerFlux, ClusterInner> beginCreateOrUpdateAs @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); } /** @@ -540,7 +658,9 @@ public SyncPoller, ClusterInner> beginCreateOrUpdate(St @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginCreateOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); } /** @@ -561,25 +681,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, String .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create or update a Log Analytics cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName The name of the Log Analytics cluster. - * @param parameters The parameters required to create or update a Log Analytics cluster. - * @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 top level Log Analytics cluster resource container on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String clusterName, - ClusterInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create or update a Log Analytics cluster. * @@ -593,7 +694,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters) { - return createOrUpdateAsync(resourceGroupName, clusterName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -611,7 +712,7 @@ public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner createOrUpdate(String resourceGroupName, String clusterName, ClusterInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, clusterName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -641,11 +742,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -654,35 +754,34 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Name of the Log Analytics Cluster. - * @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} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - Context context) { + private Response deleteWithResponse(String resourceGroupName, String clusterName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, clusterName, apiVersion, - this.client.getSubscriptionId(), accept, context); + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); } /** @@ -690,16 +789,35 @@ private Mono>> deleteWithResponseAsync(String resource * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Name of the Log Analytics Cluster. + * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String clusterName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, clusterName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -707,19 +825,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Name of the Log Analytics Cluster. - * @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 PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -734,7 +849,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { - return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -751,7 +867,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, clusterName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -769,23 +886,6 @@ private Mono deleteAsync(String resourceGroupName, String clusterName) { return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes a cluster instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Name of the Log Analytics Cluster. - * @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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes a cluster instance. * @@ -797,7 +897,7 @@ private Mono deleteAsync(String resourceGroupName, String clusterName, Con */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName) { - deleteAsync(resourceGroupName, clusterName).block(); + beginDelete(resourceGroupName, clusterName).getFinalResult(); } /** @@ -812,7 +912,7 @@ public void delete(String resourceGroupName, String clusterName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String clusterName, Context context) { - deleteAsync(resourceGroupName, clusterName, context).block(); + beginDelete(resourceGroupName, clusterName, context).getFinalResult(); } /** @@ -843,50 +943,14 @@ private Mono> getByResourceGroupWithResponseAsync(String if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, apiVersion, clusterName, accept, context)) + .withContext( + context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), clusterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a Log Analytics cluster instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Name of the Log Analytics Cluster. - * @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 Log Analytics cluster instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String clusterName, 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - apiVersion, clusterName, accept, context); - } - /** * Gets a Log Analytics cluster instance. * @@ -917,7 +981,27 @@ private Mono getByResourceGroupAsync(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, this.client.getApiVersion(), clusterName, accept, context); } /** @@ -970,11 +1054,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, clusterName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -984,41 +1067,41 @@ private Mono>> updateWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Name of the Log Analytics Cluster. * @param parameters The parameters required to patch a Log Analytics cluster. - * @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 top level Log Analytics cluster resource container along with {@link Response} on successful - * completion of {@link Mono}. + * @return the top level Log Analytics cluster resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - ClusterPatch parameters, Context context) { + private Response updateWithResponse(String resourceGroupName, String clusterName, + ClusterPatch parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, clusterName, apiVersion, - this.client.getSubscriptionId(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), resourceGroupName, clusterName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); } /** @@ -1027,17 +1110,42 @@ private Mono>> updateWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Name of the Log Analytics Cluster. * @param parameters The parameters required to patch a Log Analytics cluster. + * @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 PollerFlux} for polling of the top level Log Analytics cluster resource container. + * @return the top level Log Analytics cluster resource container along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterInner> beginUpdateAsync(String resourceGroupName, - String clusterName, ClusterPatch parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String clusterName, + ClusterPatch parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (clusterName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), resourceGroupName, clusterName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -1046,7 +1154,6 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Name of the Log Analytics Cluster. * @param parameters The parameters required to patch a Log Analytics cluster. - * @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. @@ -1054,12 +1161,10 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ClusterInner> beginUpdateAsync(String resourceGroupName, - String clusterName, ClusterPatch parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, clusterName, parameters, context); + String clusterName, ClusterPatch parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterInner.class, ClusterInner.class, context); + ClusterInner.class, ClusterInner.class, this.client.getContext()); } /** @@ -1076,7 +1181,9 @@ private PollerFlux, ClusterInner> beginUpdateAsync(Stri @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate(String resourceGroupName, String clusterName, ClusterPatch parameters) { - return this.beginUpdateAsync(resourceGroupName, clusterName, parameters).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, clusterName, parameters); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + Context.NONE); } /** @@ -1094,7 +1201,9 @@ public SyncPoller, ClusterInner> beginUpdate(String res @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ClusterInner> beginUpdate(String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, clusterName, parameters, context).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, clusterName, parameters, context); + return this.client.getLroResult(response, ClusterInner.class, ClusterInner.class, + context); } /** @@ -1114,25 +1223,6 @@ private Mono updateAsync(String resourceGroupName, String clusterN .flatMap(this.client::getLroFinalResultOrError); } - /** - * Updates a Log Analytics cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Name of the Log Analytics Cluster. - * @param parameters The parameters required to patch a Log Analytics cluster. - * @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 top level Log Analytics cluster resource container on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, ClusterPatch parameters, - Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Updates a Log Analytics cluster. * @@ -1146,7 +1236,7 @@ private Mono updateAsync(String resourceGroupName, String clusterN */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch parameters) { - return updateAsync(resourceGroupName, clusterName, parameters).block(); + return beginUpdate(resourceGroupName, clusterName, parameters).getFinalResult(); } /** @@ -1163,7 +1253,7 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster */ @ServiceMethod(returns = ReturnType.SINGLE) public ClusterInner update(String resourceGroupName, String clusterName, ClusterPatch parameters, Context context) { - return updateAsync(resourceGroupName, clusterName, parameters, context).block(); + return beginUpdate(resourceGroupName, clusterName, parameters, context).getFinalResult(); } /** @@ -1173,7 +1263,7 @@ public ClusterInner update(String resourceGroupName, String clusterName, Cluster * @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 list clusters operation response along with {@link PagedResponse} on successful completion of + * @return log Analytics clusters in a resource group along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1194,6 +1284,33 @@ private Mono> listByResourceGroupNextSinglePageAsync .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 log Analytics clusters in a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(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. * @@ -1202,23 +1319,24 @@ private Mono> listByResourceGroupNextSinglePageAsync * @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 list clusters operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return log Analytics clusters in a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1228,7 +1346,7 @@ private Mono> listByResourceGroupNextSinglePageAsync * @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 list clusters operation response along with {@link PagedResponse} on successful completion of + * @return the Log Analytics clusters in a subscription along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1247,6 +1365,33 @@ private Mono> listNextSinglePageAsync(String nextLin .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 Log Analytics clusters in a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. * @@ -1255,22 +1400,24 @@ private Mono> listNextSinglePageAsync(String nextLin * @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 list clusters operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the Log Analytics clusters in a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + 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); } + + private static final ClientLogger LOGGER = new ClientLogger(ClustersClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java index cc3f35ee6341..30251c939268 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataExportsClientImpl.java @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.DataExportsClient; import com.azure.resourcemanager.loganalytics.fluent.models.DataExportInner; import com.azure.resourcemanager.loganalytics.models.DataExportListResult; @@ -63,7 +64,7 @@ public final class DataExportsClientImpl implements DataExportsClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientDataExports") public interface DataExportsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports") @@ -74,6 +75,15 @@ Mono> listByWorkspace(@HostParam("$host") String @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") @ExpectedResponses({ 200, 201 }) @@ -85,6 +95,17 @@ Mono> createOrUpdate(@HostParam("$host") String endpoi @BodyParam("application/json") DataExportInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") DataExportInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") @ExpectedResponses({ 200 }) @@ -95,6 +116,16 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") @ExpectedResponses({ 200, 404 }) @@ -104,6 +135,16 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}") + @ExpectedResponses({ 200, 404 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataExportName") String dataExportName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } /** @@ -135,11 +176,10 @@ private Mono> listByWorkspaceSinglePageAsync(Stri if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -150,39 +190,14 @@ private Mono> listByWorkspaceSinglePageAsync(Stri * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @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 result of the request to list data exports along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return result of the request to list data exports as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -193,11 +208,34 @@ private Mono> listByWorkspaceSinglePageAsync(Stri * @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 result of the request to list data exports as paginated response with {@link PagedFlux}. + * @return result of the request to list data exports along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -209,12 +247,35 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName * @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 result of the request to list data exports as paginated response with {@link PagedFlux}. + * @return result of the request to list data exports along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -229,7 +290,7 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName)); } /** @@ -246,7 +307,7 @@ public PagedIterable listByWorkspace(String resourceGroupName, @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context)); } /** @@ -288,61 +349,14 @@ private Mono> createOrUpdateWithResponseAsync(String r } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, dataExportName, apiVersion, parameters, accept, context)) + resourceGroupName, workspaceName, dataExportName, this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create or update a data export. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataExportName The data export rule name. - * @param parameters The parameters required to create or update a data export. - * @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 top level data export resource container along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String dataExportName, DataExportInner parameters, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataExportName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, dataExportName, apiVersion, parameters, accept, context); - } - /** * Create or update a data export. * @@ -378,8 +392,37 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String dataExportName, DataExportInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataExportName, parameters, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataExportName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataExportName, this.client.getApiVersion(), parameters, accept, context); } /** @@ -433,54 +476,13 @@ private Mono> getWithResponseAsync(String resourceGrou if (dataExportName == null) { return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, dataExportName, apiVersion, accept, context)) + resourceGroupName, workspaceName, dataExportName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a data export instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataExportName The data export rule 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 a data export instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String dataExportName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataExportName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - dataExportName, apiVersion, accept, context); - } - /** * Gets a data export instance. * @@ -513,7 +515,31 @@ private Mono getAsync(String resourceGroupName, String workspac @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String dataExportName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, dataExportName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataExportName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataExportName, this.client.getApiVersion(), accept, context); } /** @@ -564,54 +590,13 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (dataExportName == null) { return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, dataExportName, apiVersion, accept, context)) + resourceGroupName, workspaceName, dataExportName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes the specified data export in a given workspace.. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataExportName The data export rule 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 {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String dataExportName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataExportName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, dataExportName, apiVersion, accept, context); - } - /** * Deletes the specified data export in a given workspace.. * @@ -644,7 +629,31 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataExportName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, dataExportName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataExportName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataExportName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, dataExportName, this.client.getApiVersion(), accept, context); } /** @@ -661,4 +670,6 @@ public Response deleteWithResponse(String resourceGroupName, String worksp public void delete(String resourceGroupName, String workspaceName, String dataExportName) { deleteWithResponse(resourceGroupName, workspaceName, dataExportName, Context.NONE); } + + private static final ClientLogger LOGGER = new ClientLogger(DataExportsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java index 79fcd6463169..f1f8487cacb5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DataSourcesClientImpl.java @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.DataSourcesClient; import com.azure.resourcemanager.loganalytics.fluent.models.DataSourceInner; import com.azure.resourcemanager.loganalytics.models.DataSourceListResult; @@ -63,7 +64,7 @@ public final class DataSourcesClientImpl implements DataSourcesClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientDataSources") public interface DataSourcesService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") @@ -76,6 +77,17 @@ Mono> createOrUpdate(@HostParam("$host") String endpoi @BodyParam("application/json") DataSourceInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") DataSourceInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") @ExpectedResponses({ 200, 204 }) @@ -85,6 +97,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") @ExpectedResponses({ 200 }) @@ -94,6 +115,15 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceName") String dataSourceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources") @ExpectedResponses({ 200 }) @@ -104,6 +134,16 @@ Mono> listByWorkspace(@HostParam("$host") String @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("$filter") String filter, @QueryParam("$skiptoken") String skiptoken, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -111,6 +151,14 @@ Mono> listByWorkspace(@HostParam("$host") String Mono> listByWorkspaceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -151,60 +199,14 @@ private Mono> createOrUpdateWithResponseAsync(String r } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + dataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create or update a data source. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceName The name of the datasource resource. - * @param parameters The parameters required to create or update a datasource. - * @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 datasources under OMS Workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String dataSourceName, DataSourceInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context); - } - /** * Create or update a data source. * @@ -240,8 +242,37 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String dataSourceName, DataSourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataSourceName, parameters, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -295,52 +326,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceName, apiVersion, this.client.getSubscriptionId(), context)) + dataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes a data source instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceName Name of the datasource. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String dataSourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceName 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, apiVersion, - this.client.getSubscriptionId(), context); - } - /** * Deletes a data source instance. * @@ -373,7 +364,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String dataSourceName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, dataSourceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -423,54 +437,13 @@ private Mono> getWithResponseAsync(String resourceGrou return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + dataSourceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a datasource instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceName Name of the datasource. - * @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 datasource instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String dataSourceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceName == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets a datasource instance. * @@ -503,7 +476,31 @@ private Mono getAsync(String resourceGroupName, String workspac @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String dataSourceName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, dataSourceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -556,11 +553,10 @@ private Mono> listByWorkspaceSinglePageAsync(Stri return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - filter, skiptoken, apiVersion, this.client.getSubscriptionId(), accept, context)) + filter, skiptoken, 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())); @@ -573,42 +569,18 @@ private Mono> listByWorkspaceSinglePageAsync(Stri * @param workspaceName The name of the workspace. * @param filter The filter to apply on the operation. * @param skiptoken Starting point of the collection of data source instances. - * @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 first page of data source instances in a workspace with the link to the next page along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the first page of data source instances in a workspace with the link to the next page as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, String filter, String skiptoken, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (filter == null) { - return Mono.error(new IllegalArgumentException("Parameter filter 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, filter, skiptoken, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + String filter, String skiptoken) { + return new PagedFlux<>( + () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); } /** @@ -617,7 +589,6 @@ private Mono> listByWorkspaceSinglePageAsync(Stri * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter The filter to apply on the operation. - * @param skiptoken Starting point of the collection of data source instances. * @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. @@ -626,7 +597,8 @@ private Mono> listByWorkspaceSinglePageAsync(Stri */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, - String filter, String skiptoken) { + String filter) { + final String skiptoken = null; return new PagedFlux<>( () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken), nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); @@ -638,19 +610,44 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param filter The filter to apply on the operation. + * @param skiptoken Starting point of the collection of data source instances. * @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 first page of data source instances in a workspace with the link to the next page as paginated - * response with {@link PagedFlux}. + * @return the first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, - String filter) { - final String skiptoken = null; - return new PagedFlux<>( - () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, + String filter, String skiptoken) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (filter == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, filter, + skiptoken, 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); } /** @@ -664,15 +661,40 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName * @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 first page of data source instances in a workspace with the link to the next page as paginated - * response with {@link PagedFlux}. + * @return the first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, String filter, String skiptoken, Context context) { - return new PagedFlux<>( - () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, filter, skiptoken, context), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (filter == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter filter is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, filter, + skiptoken, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -691,7 +713,8 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, String filter) { final String skiptoken = null; - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, filter, skiptoken)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, filter, skiptoken), + nextLink -> listByWorkspaceNextSinglePage(nextLink)); } /** @@ -711,7 +734,9 @@ public PagedIterable listByWorkspace(String resourceGroupName, @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, String filter, String skiptoken, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, filter, skiptoken, context)); + return new PagedIterable<>( + () -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, filter, skiptoken, context), + nextLink -> listByWorkspaceNextSinglePage(nextLink, context)); } /** @@ -721,8 +746,8 @@ public PagedIterable listByWorkspace(String resourceGroupName, * @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 list data source by workspace operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listByWorkspaceNextSinglePageAsync(String nextLink) { @@ -741,6 +766,34 @@ private Mono> listByWorkspaceNextSinglePageAsync( .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 first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(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. * @@ -749,22 +802,26 @@ private Mono> listByWorkspaceNextSinglePageAsync( * @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 list data source by workspace operation response along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the first page of data source instances in a workspace with the link to the next page along with + * {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listByWorkspaceNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(DataSourcesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java index 69fc3b58644c..41aa645c5021 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/DeletedWorkspacesClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.DeletedWorkspacesClient; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; import com.azure.resourcemanager.loganalytics.models.WorkspaceListResult; @@ -60,7 +61,7 @@ public final class DeletedWorkspacesClientImpl implements DeletedWorkspacesClien * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientDeletedWorkspaces") public interface DeletedWorkspacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces") @@ -70,6 +71,14 @@ Mono> list(@HostParam("$host") 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.OperationalInsights/deletedWorkspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") 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}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces") @ExpectedResponses({ 200 }) @@ -77,6 +86,14 @@ Mono> list(@HostParam("$host") String endpoint, Mono> listByResourceGroup(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/deletedWorkspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); } /** @@ -97,11 +114,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -110,29 +126,14 @@ private Mono> listSinglePageAsync() { /** * Gets recently deleted workspaces in a subscription, available for recovery. * - * @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 recently deleted workspaces in a subscription, available for recovery along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return recently deleted workspaces in a subscription, available for recovery as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); } /** @@ -140,12 +141,25 @@ private Mono> listSinglePageAsync(Context context) * * @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 recently deleted workspaces in a subscription, available for recovery as paginated response with - * {@link PagedFlux}. + * @return recently deleted workspaces in a subscription, available for recovery along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -155,12 +169,25 @@ private PagedFlux listAsync() { * @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 recently deleted workspaces in a subscription, available for recovery as paginated response with - * {@link PagedFlux}. + * @return recently deleted workspaces in a subscription, available for recovery along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -173,7 +200,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage()); } /** @@ -188,7 +215,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context)); } /** @@ -215,11 +242,10 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -229,36 +255,15 @@ private Mono> listByResourceGroupSinglePageAsync(S * Gets recently deleted workspaces in a resource group, available for recovery. * * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return recently deleted workspaces in a resource group, available for recovery along with {@link PagedResponse} - * on successful completion of {@link Mono}. + * @return recently deleted workspaces in a resource group, available for recovery as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); } /** @@ -268,12 +273,29 @@ private Mono> listByResourceGroupSinglePageAsync(S * @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 recently deleted workspaces in a resource group, available for recovery as paginated response with - * {@link PagedFlux}. + * @return recently deleted workspaces in a resource group, available for recovery along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -284,12 +306,29 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * @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 recently deleted workspaces in a resource group, available for recovery as paginated response with - * {@link PagedFlux}. + * @return recently deleted workspaces in a resource group, available for recovery along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -304,7 +343,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName)); } /** @@ -320,6 +359,8 @@ public PagedIterable listByResourceGroup(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(DeletedWorkspacesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java index cc9b1d782cc7..def0f096476d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/GatewaysClientImpl.java @@ -20,6 +20,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.GatewaysClient; import reactor.core.publisher.Mono; @@ -52,7 +53,7 @@ public final class GatewaysClientImpl implements GatewaysClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientGateways") public interface GatewaysService { @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}") @@ -62,6 +63,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @PathParam("gatewayId") String gatewayId, @QueryParam("api-version") String apiVersion, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("gatewayId") String gatewayId, @QueryParam("api-version") String apiVersion, Context context); } /** @@ -96,52 +106,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (gatewayId == null) { return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, gatewayId, apiVersion, context)) + resourceGroupName, workspaceName, gatewayId, this.client.getApiVersion(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Delete a Log Analytics gateway. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param gatewayId The Log Analytics gateway Id. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String gatewayId, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (gatewayId == null) { - return Mono.error(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, gatewayId, apiVersion, context); - } - /** * Delete a Log Analytics gateway. * @@ -173,7 +143,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String gatewayId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, gatewayId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (gatewayId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter gatewayId is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, gatewayId, this.client.getApiVersion(), context); } /** @@ -190,4 +183,6 @@ public Response deleteWithResponse(String resourceGroupName, String worksp public void delete(String resourceGroupName, String workspaceName, String gatewayId) { deleteWithResponse(resourceGroupName, workspaceName, gatewayId, Context.NONE); } + + private static final ClientLogger LOGGER = new ClientLogger(GatewaysClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java index adf553c5c7b2..34dd79cae562 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/IntelligencePacksClientImpl.java @@ -22,6 +22,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.IntelligencePacksClient; import com.azure.resourcemanager.loganalytics.fluent.models.IntelligencePackInner; import java.util.List; @@ -57,7 +58,7 @@ public final class IntelligencePacksClientImpl implements IntelligencePacksClien * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientIntelligencePacks") public interface IntelligencePacksService { @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable") @@ -69,6 +70,16 @@ Mono> disable(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response disableSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("intelligencePackName") String intelligencePackName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable") @ExpectedResponses({ 200 }) @@ -79,6 +90,16 @@ Mono> enable(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response enableSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("intelligencePackName") String intelligencePackName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks") @ExpectedResponses({ 200 }) @@ -87,6 +108,15 @@ Mono>> list(@HostParam("$host") String endp @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/intelligencePacks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response> listSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -122,53 +152,12 @@ private Mono> disableWithResponseAsync(String resourceGroupName, return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.disable(this.client.getEndpoint(), resourceGroupName, workspaceName, - intelligencePackName, apiVersion, this.client.getSubscriptionId(), context)) + intelligencePackName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Disables an intelligence pack for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param intelligencePackName The name of the intelligence pack to be disabled. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> disableWithResponseAsync(String resourceGroupName, String workspaceName, - String intelligencePackName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (intelligencePackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter intelligencePackName 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.disable(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, - apiVersion, this.client.getSubscriptionId(), context); - } - /** * Disables an intelligence pack for a given workspace. * @@ -201,7 +190,30 @@ private Mono disableAsync(String resourceGroupName, String workspaceName, @ServiceMethod(returns = ReturnType.SINGLE) public Response disableWithResponse(String resourceGroupName, String workspaceName, String intelligencePackName, Context context) { - return disableWithResponseAsync(resourceGroupName, workspaceName, intelligencePackName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (intelligencePackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter intelligencePackName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.disableSync(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -252,53 +264,12 @@ private Mono> enableWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.enable(this.client.getEndpoint(), resourceGroupName, workspaceName, - intelligencePackName, apiVersion, this.client.getSubscriptionId(), context)) + intelligencePackName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Enables an intelligence pack for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param intelligencePackName The name of the intelligence pack to be enabled. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> enableWithResponseAsync(String resourceGroupName, String workspaceName, - String intelligencePackName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (intelligencePackName == null) { - return Mono - .error(new IllegalArgumentException("Parameter intelligencePackName 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.enable(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, - apiVersion, this.client.getSubscriptionId(), context); - } - /** * Enables an intelligence pack for a given workspace. * @@ -331,7 +302,30 @@ private Mono enableAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response enableWithResponse(String resourceGroupName, String workspaceName, String intelligencePackName, Context context) { - return enableWithResponseAsync(resourceGroupName, workspaceName, intelligencePackName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (intelligencePackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter intelligencePackName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.enableSync(this.client.getEndpoint(), resourceGroupName, workspaceName, intelligencePackName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -377,50 +371,13 @@ private Mono>> listWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @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 array of IntelligencePack along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> listWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. * @@ -450,7 +407,27 @@ private Mono> listAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response> listWithResponse(String resourceGroupName, String workspaceName, Context context) { - return listWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -467,4 +444,6 @@ public Response> listWithResponse(String resourceGro public List list(String resourceGroupName, String workspaceName) { return listWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(IntelligencePacksClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java index fd4b651ecddc..bf10d55b3740 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedServicesClientImpl.java @@ -27,8 +27,10 @@ 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.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.loganalytics.fluent.LinkedServicesClient; @@ -68,7 +70,7 @@ public final class LinkedServicesClientImpl implements LinkedServicesClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientLinkedServices") public interface LinkedServicesService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") @@ -81,6 +83,17 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") LinkedServiceInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("linkedServiceName") String linkedServiceName, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LinkedServiceInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") @ExpectedResponses({ 200, 202, 204 }) @@ -90,6 +103,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @PathParam("linkedServiceName") String linkedServiceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("linkedServiceName") String linkedServiceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") @ExpectedResponses({ 200 }) @@ -99,6 +121,15 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("linkedServiceName") String linkedServiceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("linkedServiceName") String linkedServiceName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices") @ExpectedResponses({ 200 }) @@ -107,6 +138,15 @@ Mono> listByWorkspace(@HostParam("$host") Stri @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedServices") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -149,11 +189,11 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - linkedServiceName, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + linkedServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -164,45 +204,46 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linkedServices resource. * @param parameters The parameters required to create or update a linked service. - * @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 top level Linked service resource container along with {@link Response} on successful completion of - * {@link Mono}. + * @return the top level Linked service resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String linkedServiceName, LinkedServiceInner parameters, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String linkedServiceName, LinkedServiceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (linkedServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + linkedServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + Context.NONE); } /** @@ -212,18 +253,47 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linkedServices resource. * @param parameters The parameters required to create or update a linked service. + * @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 PollerFlux} for polling of the top level Linked service resource container. + * @return the top level Linked service resource container along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LinkedServiceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkedServiceInner.class, LinkedServiceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String linkedServiceName, LinkedServiceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (linkedServiceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + linkedServiceName, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context); } /** @@ -233,7 +303,6 @@ private PollerFlux, LinkedServiceInner> beginCrea * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linkedServices resource. * @param parameters The parameters required to create or update a linked service. - * @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. @@ -241,13 +310,11 @@ private PollerFlux, LinkedServiceInner> beginCrea */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LinkedServiceInner> beginCreateOrUpdateAsync( - String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters, - Context context) { - context = this.client.mergeContext(context); + String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkedServiceInner.class, LinkedServiceInner.class, context); + LinkedServiceInner.class, LinkedServiceInner.class, this.client.getContext()); } /** @@ -265,8 +332,10 @@ private PollerFlux, LinkedServiceInner> beginCrea @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, linkedServiceName, parameters); + return this.client.getLroResult(response, LinkedServiceInner.class, + LinkedServiceInner.class, Context.NONE); } /** @@ -285,8 +354,10 @@ public SyncPoller, LinkedServiceInner> beginCreat @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, linkedServiceName, parameters, context); + return this.client.getLroResult(response, LinkedServiceInner.class, + LinkedServiceInner.class, context); } /** @@ -308,26 +379,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, S .flatMap(this.client::getLroFinalResultOrError); } - /** - * Create or update a linked service. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param linkedServiceName Name of the linkedServices resource. - * @param parameters The parameters required to create or update a linked service. - * @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 top level Linked service resource container on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, - String linkedServiceName, LinkedServiceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Create or update a linked service. * @@ -343,7 +394,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public LinkedServiceInner createOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters) { - return createOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, workspaceName, linkedServiceName, parameters).getFinalResult(); } /** @@ -362,7 +413,8 @@ public LinkedServiceInner createOrUpdate(String resourceGroupName, String worksp @ServiceMethod(returns = ReturnType.SINGLE) public LinkedServiceInner createOrUpdate(String resourceGroupName, String workspaceName, String linkedServiceName, LinkedServiceInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, workspaceName, linkedServiceName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, workspaceName, linkedServiceName, parameters, context) + .getFinalResult(); } /** @@ -399,11 +451,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - linkedServiceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + linkedServiceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -413,40 +464,39 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linked service. - * @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 top level Linked service resource container along with {@link Response} on successful completion of - * {@link Mono}. + * @return the top level Linked service resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String linkedServiceName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String workspaceName, + String linkedServiceName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (linkedServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, - apiVersion, this.client.getSubscriptionId(), accept, context); + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); } /** @@ -455,18 +505,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linked service. + * @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 PollerFlux} for polling of the top level Linked service resource container. + * @return the top level Linked service resource container along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, LinkedServiceInner> beginDeleteAsync(String resourceGroupName, - String workspaceName, String linkedServiceName) { - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkedServiceInner.class, LinkedServiceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, + String linkedServiceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (linkedServiceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -475,7 +547,6 @@ private PollerFlux, LinkedServiceInner> beginDele * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param linkedServiceName Name of the linked service. - * @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. @@ -483,12 +554,11 @@ private PollerFlux, LinkedServiceInner> beginDele */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, LinkedServiceInner> beginDeleteAsync(String resourceGroupName, - String workspaceName, String linkedServiceName, Context context) { - context = this.client.mergeContext(context); + String workspaceName, String linkedServiceName) { Mono>> mono - = deleteWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, context); + = deleteWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - LinkedServiceInner.class, LinkedServiceInner.class, context); + LinkedServiceInner.class, LinkedServiceInner.class, this.client.getContext()); } /** @@ -505,7 +575,9 @@ private PollerFlux, LinkedServiceInner> beginDele @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginDelete(String resourceGroupName, String workspaceName, String linkedServiceName) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, linkedServiceName); + return this.client.getLroResult(response, LinkedServiceInner.class, + LinkedServiceInner.class, Context.NONE); } /** @@ -523,7 +595,10 @@ public SyncPoller, LinkedServiceInner> beginDelet @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, LinkedServiceInner> beginDelete(String resourceGroupName, String workspaceName, String linkedServiceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName, context).getSyncPoller(); + Response response + = deleteWithResponse(resourceGroupName, workspaceName, linkedServiceName, context); + return this.client.getLroResult(response, LinkedServiceInner.class, + LinkedServiceInner.class, context); } /** @@ -544,25 +619,6 @@ private Mono deleteAsync(String resourceGroupName, String wo .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes a linked service instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param linkedServiceName Name of the linked service. - * @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 top level Linked service resource container on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, - String linkedServiceName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, linkedServiceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes a linked service instance. * @@ -576,7 +632,7 @@ private Mono deleteAsync(String resourceGroupName, String wo */ @ServiceMethod(returns = ReturnType.SINGLE) public LinkedServiceInner delete(String resourceGroupName, String workspaceName, String linkedServiceName) { - return deleteAsync(resourceGroupName, workspaceName, linkedServiceName).block(); + return beginDelete(resourceGroupName, workspaceName, linkedServiceName).getFinalResult(); } /** @@ -594,7 +650,7 @@ public LinkedServiceInner delete(String resourceGroupName, String workspaceName, @ServiceMethod(returns = ReturnType.SINGLE) public LinkedServiceInner delete(String resourceGroupName, String workspaceName, String linkedServiceName, Context context) { - return deleteAsync(resourceGroupName, workspaceName, linkedServiceName, context).block(); + return beginDelete(resourceGroupName, workspaceName, linkedServiceName, context).getFinalResult(); } /** @@ -630,55 +686,13 @@ private Mono> getWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - linkedServiceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + linkedServiceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a linked service instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param linkedServiceName Name of the linked service. - * @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 linked service instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String linkedServiceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (linkedServiceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter linkedServiceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets a linked service instance. * @@ -712,7 +726,31 @@ private Mono getAsync(String resourceGroupName, String works @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String linkedServiceName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, linkedServiceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (linkedServiceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter linkedServiceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, linkedServiceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -760,11 +798,10 @@ private Mono> listByWorkspaceSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -775,39 +812,14 @@ private Mono> listByWorkspaceSinglePageAsync(S * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @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 linked services instances in a workspace along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the linked services instances in a workspace as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -818,11 +830,35 @@ private Mono> listByWorkspaceSinglePageAsync(S * @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 linked services instances in a workspace as paginated response with {@link PagedFlux}. + * @return the linked services instances in a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, + String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -834,12 +870,35 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupN * @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 linked services instances in a workspace as paginated response with {@link PagedFlux}. + * @return the linked services instances in a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -854,7 +913,7 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName)); } /** @@ -871,6 +930,8 @@ public PagedIterable listByWorkspace(String resourceGroupNam @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(LinkedServicesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java index 14c65e99b288..4fc3b5dbc3fe 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LinkedStorageAccountsClientImpl.java @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.LinkedStorageAccountsClient; import com.azure.resourcemanager.loganalytics.fluent.models.LinkedStorageAccountsResourceInner; import com.azure.resourcemanager.loganalytics.models.DataSourceType; @@ -64,7 +65,7 @@ public final class LinkedStorageAccountsClientImpl implements LinkedStorageAccou * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientLinkedStorageAccounts") public interface LinkedStorageAccountsService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") @@ -77,6 +78,17 @@ Mono> createOrUpdate(@HostParam("$h @BodyParam("application/json") LinkedStorageAccountsResourceInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceType") DataSourceType dataSourceType, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LinkedStorageAccountsResourceInner parameters, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") @ExpectedResponses({ 200 }) @@ -86,6 +98,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("dataSourceType") DataSourceType dataSourceType, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceType") DataSourceType dataSourceType, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") @ExpectedResponses({ 200 }) @@ -95,6 +116,15 @@ Mono> get(@HostParam("$host") Strin @PathParam("dataSourceType") DataSourceType dataSourceType, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("dataSourceType") DataSourceType dataSourceType, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts") @ExpectedResponses({ 200 }) @@ -103,6 +133,15 @@ Mono> listByWorkspace(@HostParam("$hos @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("workspaceName") String workspaceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("workspaceName") String workspaceName, @HeaderParam("Accept") String accept, Context context); } /** @@ -145,63 +184,14 @@ private Mono> createOrUpdateWithRes } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceType, this.client.getSubscriptionId(), apiVersion, parameters, accept, context)) + dataSourceType, this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create or Update a link relation between current workspace and a group of storage accounts of a specific data - * source type. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceType Linked storage accounts type. - * @param parameters The parameters required to create or update linked storage accounts. - * @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 linked storage accounts top level resource container along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, DataSourceType dataSourceType, LinkedStorageAccountsResourceInner parameters, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceType 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, - this.client.getSubscriptionId(), apiVersion, parameters, accept, context); - } - /** * Create or Update a link relation between current workspace and a group of storage accounts of a specific data * source type. @@ -240,8 +230,37 @@ private Mono createOrUpdateAsync(String reso public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, LinkedStorageAccountsResourceInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, dataSourceType, parameters, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, + this.client.getSubscriptionId(), this.client.getApiVersion(), parameters, accept, context); } /** @@ -296,52 +315,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceType, apiVersion, this.client.getSubscriptionId(), context)) + dataSourceType, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes all linked storage accounts of a specific data source type associated with the specified workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceType Linked storage accounts type. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - DataSourceType dataSourceType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceType 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, apiVersion, - this.client.getSubscriptionId(), context); - } - /** * Deletes all linked storage accounts of a specific data source type associated with the specified workspace. * @@ -374,7 +353,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, D @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, dataSourceType, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -425,55 +427,13 @@ private Mono> getWithResponseAsync( return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - dataSourceType, apiVersion, this.client.getSubscriptionId(), accept, context)) + dataSourceType, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets all linked storage account of a specific data source type associated with the specified workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param dataSourceType Linked storage accounts type. - * @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 all linked storage account of a specific data source type associated with the specified workspace along - * with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String workspaceName, DataSourceType dataSourceType, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (dataSourceType == null) { - return Mono.error(new IllegalArgumentException("Parameter dataSourceType 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets all linked storage account of a specific data source type associated with the specified workspace. * @@ -509,7 +469,31 @@ private Mono getAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, DataSourceType dataSourceType, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, dataSourceType, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (dataSourceType == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter dataSourceType is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, dataSourceType, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -559,11 +543,10 @@ public LinkedStorageAccountsResourceInner get(String resourceGroupName, String w if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, apiVersion, workspaceName, accept, context)) + resourceGroupName, this.client.getApiVersion(), workspaceName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -575,39 +558,16 @@ public LinkedStorageAccountsResourceInner get(String resourceGroupName, String w * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @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 all linked storage accounts associated with the specified workspace, storage accounts will be sorted by - * their data source type along with {@link PagedResponse} on successful completion of {@link Mono}. + * their data source type as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, apiVersion, - workspaceName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, + String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -620,12 +580,35 @@ public LinkedStorageAccountsResourceInner get(String resourceGroupName, String w * @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 all linked storage accounts associated with the specified workspace, storage accounts will be sorted by - * their data source type as paginated response with {@link PagedFlux}. + * their data source type along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), workspaceName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -639,12 +622,35 @@ private PagedFlux listByWorkspaceAsync(Strin * @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 all linked storage accounts associated with the specified workspace, storage accounts will be sorted by - * their data source type as paginated response with {@link PagedFlux}. + * their data source type along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + this.client.getApiVersion(), workspaceName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -662,7 +668,7 @@ private PagedFlux listByWorkspaceAsync(Strin @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName)); } /** @@ -681,6 +687,8 @@ public PagedIterable listByWorkspace(String @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(LinkedStorageAccountsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java index 96d8b006e861..f2dfcbe42f25 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/LogAnalyticsQueryPackImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -44,6 +45,10 @@ public Map tags() { } } + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String queryPackId() { return this.innerModel().queryPackId(); } @@ -179,6 +184,6 @@ public LogAnalyticsQueryPackImpl withTags(Map tags) { } private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java index 411b94fc8e02..e7b959814944 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/ManagementGroupsClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.ManagementGroupsClient; import com.azure.resourcemanager.loganalytics.fluent.models.ManagementGroupInner; import com.azure.resourcemanager.loganalytics.models.WorkspaceListManagementGroupsResult; @@ -60,7 +61,7 @@ public final class ManagementGroupsClientImpl implements ManagementGroupsClient * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientManagementGroups") public interface ManagementGroupsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups") @@ -70,6 +71,15 @@ Mono> list(@HostParam("$host") Str @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/managementGroups") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -101,11 +111,10 @@ private Mono> listSinglePageAsync(String res return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -116,39 +125,14 @@ private Mono> listSinglePageAsync(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @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 of management groups connected to a workspace along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of management groups connected to a workspace as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -159,11 +143,34 @@ private Mono> listSinglePageAsync(String res * @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 of management groups connected to a workspace as paginated response with {@link PagedFlux}. + * @return a list of management groups connected to a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -175,11 +182,35 @@ private PagedFlux listAsync(String resourceGroupName, Stri * @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 of management groups connected to a workspace as paginated response with {@link PagedFlux}. + * @return a list of management groups connected to a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -194,7 +225,7 @@ private PagedFlux listAsync(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName)); } /** @@ -210,6 +241,8 @@ public PagedIterable list(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(ManagementGroupsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/NetworkSecurityPerimeterConfigurationImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/NetworkSecurityPerimeterConfigurationImpl.java new file mode 100644 index 000000000000..ae651a8b7628 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/NetworkSecurityPerimeterConfigurationImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfiguration; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; + +public final class NetworkSecurityPerimeterConfigurationImpl implements NetworkSecurityPerimeterConfiguration { + private NetworkSecurityPerimeterConfigurationInner innerObject; + + private final com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager; + + NetworkSecurityPerimeterConfigurationImpl(NetworkSecurityPerimeterConfigurationInner innerObject, + com.azure.resourcemanager.loganalytics.LogAnalyticsManager 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 NetworkSecurityPerimeterConfigurationProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public NetworkSecurityPerimeterConfigurationInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java index f0da81820b4d..9f3f7c2ae27c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationStatusesClientImpl.java @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.OperationStatusesClient; import com.azure.resourcemanager.loganalytics.fluent.models.OperationStatusInner; import reactor.core.publisher.Mono; @@ -55,7 +56,7 @@ public final class OperationStatusesClientImpl implements OperationStatusesClien * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientOperationStatuses") public interface OperationStatusesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}") @@ -65,6 +66,15 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("location") String location, @PathParam("asyncOperationId") String asyncOperationId, @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.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("location") String location, @PathParam("asyncOperationId") String asyncOperationId, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -95,51 +105,13 @@ private Mono> getWithResponseAsync(String locatio return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), location, asyncOperationId, apiVersion, - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), location, asyncOperationId, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Get the status of a long running azure asynchronous operation. - * - * @param location The region name of operation. - * @param asyncOperationId The operation Id. - * @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 long running azure asynchronous operation along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String asyncOperationId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (asyncOperationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter asyncOperationId 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), location, asyncOperationId, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Get the status of a long running azure asynchronous operation. * @@ -168,7 +140,27 @@ private Mono getAsync(String location, String asyncOperati */ @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String location, String asyncOperationId, Context context) { - return getWithResponseAsync(location, asyncOperationId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (asyncOperationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter asyncOperationId is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), location, asyncOperationId, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** @@ -185,4 +177,6 @@ public Response getWithResponse(String location, String as public OperationStatusInner get(String location, String asyncOperationId) { return getWithResponse(location, asyncOperationId, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java index d0f29df2b257..558e2b218eee 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationalInsightsManagementClientImpl.java @@ -15,12 +15,15 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.fluent.AvailableServiceTiersClient; @@ -42,6 +45,7 @@ import com.azure.resourcemanager.loganalytics.fluent.SchemasClient; import com.azure.resourcemanager.loganalytics.fluent.SharedKeysOperationsClient; import com.azure.resourcemanager.loganalytics.fluent.StorageInsightConfigsClient; +import com.azure.resourcemanager.loganalytics.fluent.SummaryLogsOperationsClient; import com.azure.resourcemanager.loganalytics.fluent.TablesClient; import com.azure.resourcemanager.loganalytics.fluent.UsagesClient; import com.azure.resourcemanager.loganalytics.fluent.WorkspacePurgesClient; @@ -88,6 +92,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * The HTTP pipeline to send requests through. */ @@ -131,31 +149,31 @@ public Duration getDefaultPollInterval() { } /** - * The QueryPacksClient object to access its operations. + * The AvailableServiceTiersClient object to access its operations. */ - private final QueryPacksClient queryPacks; + private final AvailableServiceTiersClient availableServiceTiers; /** - * Gets the QueryPacksClient object to access its operations. + * Gets the AvailableServiceTiersClient object to access its operations. * - * @return the QueryPacksClient object. + * @return the AvailableServiceTiersClient object. */ - public QueryPacksClient getQueryPacks() { - return this.queryPacks; + public AvailableServiceTiersClient getAvailableServiceTiers() { + return this.availableServiceTiers; } /** - * The QueriesClient object to access its operations. + * The ClustersClient object to access its operations. */ - private final QueriesClient queries; + private final ClustersClient clusters; /** - * Gets the QueriesClient object to access its operations. + * Gets the ClustersClient object to access its operations. * - * @return the QueriesClient object. + * @return the ClustersClient object. */ - public QueriesClient getQueries() { - return this.queries; + public ClustersClient getClusters() { + return this.clusters; } /** @@ -186,6 +204,20 @@ public DataSourcesClient getDataSources() { return this.dataSources; } + /** + * The GatewaysClient object to access its operations. + */ + private final GatewaysClient gateways; + + /** + * Gets the GatewaysClient object to access its operations. + * + * @return the GatewaysClient object. + */ + public GatewaysClient getGateways() { + return this.gateways; + } + /** * The IntelligencePacksClient object to access its operations. */ @@ -243,59 +275,59 @@ public ManagementGroupsClient getManagementGroups() { } /** - * The OperationStatusesClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final OperationStatusesClient operationStatuses; + private final OperationsClient operations; /** - * Gets the OperationStatusesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the OperationStatusesClient object. + * @return the OperationsClient object. */ - public OperationStatusesClient getOperationStatuses() { - return this.operationStatuses; + public OperationsClient getOperations() { + return this.operations; } /** - * The SharedKeysOperationsClient object to access its operations. + * The OperationStatusesClient object to access its operations. */ - private final SharedKeysOperationsClient sharedKeysOperations; + private final OperationStatusesClient operationStatuses; /** - * Gets the SharedKeysOperationsClient object to access its operations. + * Gets the OperationStatusesClient object to access its operations. * - * @return the SharedKeysOperationsClient object. + * @return the OperationStatusesClient object. */ - public SharedKeysOperationsClient getSharedKeysOperations() { - return this.sharedKeysOperations; + public OperationStatusesClient getOperationStatuses() { + return this.operationStatuses; } /** - * The UsagesClient object to access its operations. + * The QueriesClient object to access its operations. */ - private final UsagesClient usages; + private final QueriesClient queries; /** - * Gets the UsagesClient object to access its operations. + * Gets the QueriesClient object to access its operations. * - * @return the UsagesClient object. + * @return the QueriesClient object. */ - public UsagesClient getUsages() { - return this.usages; + public QueriesClient getQueries() { + return this.queries; } /** - * The StorageInsightConfigsClient object to access its operations. + * The QueryPacksClient object to access its operations. */ - private final StorageInsightConfigsClient storageInsightConfigs; + private final QueryPacksClient queryPacks; /** - * Gets the StorageInsightConfigsClient object to access its operations. + * Gets the QueryPacksClient object to access its operations. * - * @return the StorageInsightConfigsClient object. + * @return the QueryPacksClient object. */ - public StorageInsightConfigsClient getStorageInsightConfigs() { - return this.storageInsightConfigs; + public QueryPacksClient getQueryPacks() { + return this.queryPacks; } /** @@ -313,87 +345,87 @@ public SavedSearchesClient getSavedSearches() { } /** - * The AvailableServiceTiersClient object to access its operations. + * The SchemasClient object to access its operations. */ - private final AvailableServiceTiersClient availableServiceTiers; + private final SchemasClient schemas; /** - * Gets the AvailableServiceTiersClient object to access its operations. + * Gets the SchemasClient object to access its operations. * - * @return the AvailableServiceTiersClient object. + * @return the SchemasClient object. */ - public AvailableServiceTiersClient getAvailableServiceTiers() { - return this.availableServiceTiers; + public SchemasClient getSchemas() { + return this.schemas; } /** - * The GatewaysClient object to access its operations. + * The SharedKeysOperationsClient object to access its operations. */ - private final GatewaysClient gateways; + private final SharedKeysOperationsClient sharedKeysOperations; /** - * Gets the GatewaysClient object to access its operations. + * Gets the SharedKeysOperationsClient object to access its operations. * - * @return the GatewaysClient object. + * @return the SharedKeysOperationsClient object. */ - public GatewaysClient getGateways() { - return this.gateways; + public SharedKeysOperationsClient getSharedKeysOperations() { + return this.sharedKeysOperations; } /** - * The SchemasClient object to access its operations. + * The StorageInsightConfigsClient object to access its operations. */ - private final SchemasClient schemas; + private final StorageInsightConfigsClient storageInsightConfigs; /** - * Gets the SchemasClient object to access its operations. + * Gets the StorageInsightConfigsClient object to access its operations. * - * @return the SchemasClient object. + * @return the StorageInsightConfigsClient object. */ - public SchemasClient getSchemas() { - return this.schemas; + public StorageInsightConfigsClient getStorageInsightConfigs() { + return this.storageInsightConfigs; } /** - * The WorkspacePurgesClient object to access its operations. + * The TablesClient object to access its operations. */ - private final WorkspacePurgesClient workspacePurges; + private final TablesClient tables; /** - * Gets the WorkspacePurgesClient object to access its operations. + * Gets the TablesClient object to access its operations. * - * @return the WorkspacePurgesClient object. + * @return the TablesClient object. */ - public WorkspacePurgesClient getWorkspacePurges() { - return this.workspacePurges; + public TablesClient getTables() { + return this.tables; } /** - * The ClustersClient object to access its operations. + * The UsagesClient object to access its operations. */ - private final ClustersClient clusters; + private final UsagesClient usages; /** - * Gets the ClustersClient object to access its operations. + * Gets the UsagesClient object to access its operations. * - * @return the ClustersClient object. + * @return the UsagesClient object. */ - public ClustersClient getClusters() { - return this.clusters; + public UsagesClient getUsages() { + return this.usages; } /** - * The OperationsClient object to access its operations. + * The WorkspacePurgesClient object to access its operations. */ - private final OperationsClient operations; + private final WorkspacePurgesClient workspacePurges; /** - * Gets the OperationsClient object to access its operations. + * Gets the WorkspacePurgesClient object to access its operations. * - * @return the OperationsClient object. + * @return the WorkspacePurgesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public WorkspacePurgesClient getWorkspacePurges() { + return this.workspacePurges; } /** @@ -425,17 +457,17 @@ public DeletedWorkspacesClient getDeletedWorkspaces() { } /** - * The TablesClient object to access its operations. + * The SummaryLogsOperationsClient object to access its operations. */ - private final TablesClient tables; + private final SummaryLogsOperationsClient summaryLogsOperations; /** - * Gets the TablesClient object to access its operations. + * Gets the SummaryLogsOperationsClient object to access its operations. * - * @return the TablesClient object. + * @return the SummaryLogsOperationsClient object. */ - public TablesClient getTables() { - return this.tables; + public SummaryLogsOperationsClient getSummaryLogsOperations() { + return this.summaryLogsOperations; } /** @@ -455,28 +487,30 @@ public TablesClient getTables() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.queryPacks = new QueryPacksClientImpl(this); - this.queries = new QueriesClientImpl(this); + this.apiVersion = "2025-07-01"; + this.availableServiceTiers = new AvailableServiceTiersClientImpl(this); + this.clusters = new ClustersClientImpl(this); this.dataExports = new DataExportsClientImpl(this); this.dataSources = new DataSourcesClientImpl(this); + this.gateways = new GatewaysClientImpl(this); this.intelligencePacks = new IntelligencePacksClientImpl(this); this.linkedServices = new LinkedServicesClientImpl(this); this.linkedStorageAccounts = new LinkedStorageAccountsClientImpl(this); this.managementGroups = new ManagementGroupsClientImpl(this); + this.operations = new OperationsClientImpl(this); this.operationStatuses = new OperationStatusesClientImpl(this); - this.sharedKeysOperations = new SharedKeysOperationsClientImpl(this); - this.usages = new UsagesClientImpl(this); - this.storageInsightConfigs = new StorageInsightConfigsClientImpl(this); + this.queries = new QueriesClientImpl(this); + this.queryPacks = new QueryPacksClientImpl(this); this.savedSearches = new SavedSearchesClientImpl(this); - this.availableServiceTiers = new AvailableServiceTiersClientImpl(this); - this.gateways = new GatewaysClientImpl(this); this.schemas = new SchemasClientImpl(this); + this.sharedKeysOperations = new SharedKeysOperationsClientImpl(this); + this.storageInsightConfigs = new StorageInsightConfigsClientImpl(this); + this.tables = new TablesClientImpl(this); + this.usages = new UsagesClientImpl(this); this.workspacePurges = new WorkspacePurgesClientImpl(this); - this.clusters = new ClustersClientImpl(this); - this.operations = new OperationsClientImpl(this); this.workspaces = new WorkspacesClientImpl(this); this.deletedWorkspaces = new DeletedWorkspacesClientImpl(this); - this.tables = new TablesClientImpl(this); + this.summaryLogsOperations = new SummaryLogsOperationsClientImpl(this); } /** @@ -516,6 +550,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java index 77996dac2fc7..555a84184171 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/OperationsClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.OperationsClient; import com.azure.resourcemanager.loganalytics.fluent.models.OperationInner; import com.azure.resourcemanager.loganalytics.models.OperationListResult; @@ -60,7 +61,7 @@ public final class OperationsClientImpl implements OperationsClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.OperationalInsights/operations") @@ -69,12 +70,26 @@ public interface OperationsService { Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.OperationalInsights/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @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("$host") 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("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -91,9 +106,10 @@ private Mono> listSinglePageAsync() { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), 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())); @@ -102,25 +118,13 @@ private Mono> listSinglePageAsync() { /** * Lists all of the available OperationalInsights Rest API operations. * - * @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 result of the request to list solution operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return result of the request to list solution operations as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -128,11 +132,20 @@ private Mono> listSinglePageAsync(Context context) * * @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 result of the request to list solution operations as paginated response with {@link PagedFlux}. + * @return result of the request to list solution operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -142,12 +155,20 @@ private PagedFlux listAsync() { * @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 result of the request to list solution operations as paginated response with {@link PagedFlux}. + * @return result of the request to list solution operations along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -159,7 +180,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -173,7 +194,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -202,6 +223,33 @@ private Mono> listNextSinglePageAsync(String nextL .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 result of the request to list solution operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. * @@ -210,22 +258,24 @@ private Mono> listNextSinglePageAsync(String nextL * @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 result of the request to list solution operations along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return result of the request to list solution operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + 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); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java index 8925e741cf34..bb2500b9b4d2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueriesClientImpl.java @@ -30,6 +30,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.QueriesClient; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackQueryInner; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQueryListResult; @@ -65,7 +66,7 @@ public final class QueriesClientImpl implements QueriesClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientQueries") public interface QueriesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries") @@ -78,6 +79,17 @@ Mono> list(@HostParam("$host") St @QueryParam("includeBody") Boolean includeBody, @QueryParam("$skipToken") String skipToken, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @QueryParam("api-version") String apiVersion, @QueryParam("$top") Long top, + @QueryParam("includeBody") Boolean includeBody, @QueryParam("$skipToken") String skipToken, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/search") @ExpectedResponses({ 200 }) @@ -90,6 +102,18 @@ Mono> search(@HostParam("$host") @BodyParam("application/json") LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/search") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response searchSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @QueryParam("api-version") String apiVersion, @QueryParam("$top") Long top, + @QueryParam("includeBody") Boolean includeBody, @QueryParam("$skipToken") String skipToken, + @BodyParam("application/json") LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") @ExpectedResponses({ 200 }) @@ -100,6 +124,16 @@ Mono> get(@HostParam("$host") String e @PathParam("id") String id, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") @ExpectedResponses({ 200 }) @@ -111,6 +145,17 @@ Mono> put(@HostParam("$host") String e @BodyParam("application/json") LogAnalyticsQueryPackQueryInner queryPayload, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response putSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LogAnalyticsQueryPackQueryInner queryPayload, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") @ExpectedResponses({ 200 }) @@ -122,6 +167,17 @@ Mono> update(@HostParam("$host") Strin @BodyParam("application/json") LogAnalyticsQueryPackQueryInner queryPayload, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") LogAnalyticsQueryPackQueryInner queryPayload, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") @ExpectedResponses({ 200, 204 }) @@ -132,6 +188,16 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("id") String id, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}/queries/{id}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("queryPackName") String queryPackName, + @PathParam("id") String id, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -140,6 +206,14 @@ Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -147,6 +221,14 @@ Mono> listNext( Mono> searchNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response searchNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -182,11 +264,11 @@ private Mono> listSinglePageAsync if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, apiVersion, top, includeBody, skipToken, accept, context)) + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, this.client.getApiVersion(), top, includeBody, 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())); @@ -201,39 +283,16 @@ private Mono> listSinglePageAsync * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only * return the query information. * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. - * @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 of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of Queries defined within a Log Analytics QueryPack as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String queryPackName, Long top, Boolean includeBody, String skipToken, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - apiVersion, top, includeBody, skipToken, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String queryPackName, + Long top, Boolean includeBody, String skipToken) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, queryPackName, top, includeBody, skipToken), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -241,18 +300,16 @@ private Mono> listSinglePageAsync * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param top Maximum items returned in page. - * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only - * return the query information. - * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. * @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 of Queries defined within a Log Analytics QueryPack as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String queryPackName, - Long top, Boolean includeBody, String skipToken) { + private PagedFlux listAsync(String resourceGroupName, String queryPackName) { + final Long top = null; + final Boolean includeBody = null; + final String skipToken = null; return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, queryPackName, top, includeBody, skipToken), nextLink -> listNextSinglePageAsync(nextLink)); } @@ -262,18 +319,42 @@ private PagedFlux listAsync(String resourceGrou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param queryPackName The name of the Log Analytics QueryPack resource. + * @param top Maximum items returned in page. + * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only + * return the query information. + * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. * @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 of Queries defined within a Log Analytics QueryPack as paginated response with {@link PagedFlux}. + * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String queryPackName) { - final Long top = null; - final Boolean includeBody = null; - final String skipToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, queryPackName, top, includeBody, skipToken), - nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String queryPackName, Long top, Boolean includeBody, String skipToken) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, this.client.getApiVersion(), top, includeBody, skipToken, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -289,14 +370,35 @@ private PagedFlux listAsync(String resourceGrou * @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 of Queries defined within a Log Analytics QueryPack as paginated response with {@link PagedFlux}. + * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String queryPackName, - Long top, Boolean includeBody, String skipToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, queryPackName, top, includeBody, skipToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, + String queryPackName, Long top, Boolean includeBody, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, this.client.getApiVersion(), top, includeBody, skipToken, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -315,7 +417,8 @@ public PagedIterable list(String resourceGroupN final Long top = null; final Boolean includeBody = null; final String skipToken = null; - return new PagedIterable<>(listAsync(resourceGroupName, queryPackName, top, includeBody, skipToken)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, queryPackName, top, includeBody, skipToken), + nextLink -> listNextSinglePage(nextLink)); } /** @@ -337,7 +440,9 @@ public PagedIterable list(String resourceGroupN @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String queryPackName, Long top, Boolean includeBody, String skipToken, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, queryPackName, top, includeBody, skipToken, context)); + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, queryPackName, top, includeBody, skipToken, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -381,69 +486,16 @@ private Mono> searchSinglePageAsy } else { querySearchProperties.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.search(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - queryPackName, apiVersion, top, includeBody, skipToken, querySearchProperties, accept, context)) + .withContext(context -> service.search(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, queryPackName, this.client.getApiVersion(), top, includeBody, skipToken, + querySearchProperties, 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())); } - /** - * Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param querySearchProperties Properties by which to search queries in the given Log Analytics QueryPack. - * @param top Maximum items returned in page. - * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only - * return the query information. - * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. - * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> searchSinglePageAsync(String resourceGroupName, - String queryPackName, LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, - Boolean includeBody, String skipToken, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (querySearchProperties == null) { - return Mono - .error(new IllegalArgumentException("Parameter querySearchProperties is required and cannot be null.")); - } else { - querySearchProperties.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .search(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - apiVersion, top, includeBody, skipToken, querySearchProperties, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - /** * Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. * @@ -490,6 +542,57 @@ private PagedFlux searchAsync(String resourceGr includeBody, skipToken), nextLink -> searchNextSinglePageAsync(nextLink)); } + /** + * Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param queryPackName The name of the Log Analytics QueryPack resource. + * @param querySearchProperties Properties by which to search queries in the given Log Analytics QueryPack. + * @param top Maximum items returned in page. + * @param includeBody Flag indicating whether or not to return the body of each applicable query. If false, only + * return the query information. + * @param skipToken Base64 encoded token used to fetch the next page of items. Default is null. + * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse searchSinglePage(String resourceGroupName, + String queryPackName, LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, + Boolean includeBody, String skipToken) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (querySearchProperties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter querySearchProperties is required and cannot be null.")); + } else { + querySearchProperties.validate(); + } + final String accept = "application/json"; + Response res = service.searchSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, queryPackName, this.client.getApiVersion(), top, + includeBody, skipToken, querySearchProperties, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Search a list of Queries defined within a Log Analytics QueryPack according to given search properties. * @@ -504,15 +607,42 @@ private PagedFlux searchAsync(String resourceGr * @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 describes the list of Log Analytics QueryPack-Query resources as paginated response with - * {@link PagedFlux}. + * @return describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux searchAsync(String resourceGroupName, String queryPackName, - LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, Boolean includeBody, - String skipToken, Context context) { - return new PagedFlux<>(() -> searchSinglePageAsync(resourceGroupName, queryPackName, querySearchProperties, top, - includeBody, skipToken, context), nextLink -> searchNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse searchSinglePage(String resourceGroupName, + String queryPackName, LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, + Boolean includeBody, String skipToken, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (querySearchProperties == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter querySearchProperties is required and cannot be null.")); + } else { + querySearchProperties.validate(); + } + final String accept = "application/json"; + Response res = service.searchSync(this.client.getEndpoint(), + this.client.getSubscriptionId(), resourceGroupName, queryPackName, this.client.getApiVersion(), top, + includeBody, skipToken, querySearchProperties, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -533,8 +663,8 @@ public PagedIterable search(String resourceGrou final Long top = null; final Boolean includeBody = null; final String skipToken = null; - return new PagedIterable<>( - searchAsync(resourceGroupName, queryPackName, querySearchProperties, top, includeBody, skipToken)); + return new PagedIterable<>(() -> searchSinglePage(resourceGroupName, queryPackName, querySearchProperties, top, + includeBody, skipToken), nextLink -> searchNextSinglePage(nextLink)); } /** @@ -558,8 +688,8 @@ public PagedIterable search(String resourceGrou public PagedIterable search(String resourceGroupName, String queryPackName, LogAnalyticsQueryPackQuerySearchProperties querySearchProperties, Long top, Boolean includeBody, String skipToken, Context context) { - return new PagedIterable<>( - searchAsync(resourceGroupName, queryPackName, querySearchProperties, top, includeBody, skipToken, context)); + return new PagedIterable<>(() -> searchSinglePage(resourceGroupName, queryPackName, querySearchProperties, top, + includeBody, skipToken, context), nextLink -> searchNextSinglePage(nextLink, context)); } /** @@ -595,55 +725,13 @@ private Mono> getWithResponseAsync(Str if (id == null) { return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a specific Log Analytics Query defined within a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param id The id of a specific query defined in the Log Analytics QueryPack. - * @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 Log Analytics Query defined within a Log Analytics QueryPack along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String queryPackName, String id, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - id, apiVersion, accept, context); - } - /** * Gets a specific Log Analytics Query defined within a Log Analytics QueryPack. * @@ -677,7 +765,30 @@ private Mono getAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String queryPackName, String id, Context context) { - return getWithResponseAsync(resourceGroupName, queryPackName, id, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (id == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, id, this.client.getApiVersion(), accept, context); } /** @@ -736,62 +847,13 @@ private Mono> putWithResponseAsync(Str } else { queryPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, queryPayload, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Adds or Updates a specific Query within a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param id The id of a specific query defined in the Log Analytics QueryPack. - * @param queryPayload Properties that need to be specified to create a new query and add it to a Log Analytics - * QueryPack. - * @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 Log Analytics QueryPack-Query definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> putWithResponseAsync(String resourceGroupName, - String queryPackName, String id, LogAnalyticsQueryPackQueryInner queryPayload, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (queryPayload == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPayload is required and cannot be null.")); - } else { - queryPayload.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.put(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, queryPackName, - id, apiVersion, queryPayload, accept, context); - } - /** * Adds or Updates a specific Query within a Log Analytics QueryPack. * @@ -829,7 +891,36 @@ private Mono putAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response putWithResponse(String resourceGroupName, String queryPackName, String id, LogAnalyticsQueryPackQueryInner queryPayload, Context context) { - return putWithResponseAsync(resourceGroupName, queryPackName, id, queryPayload, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (id == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (queryPayload == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPayload is required and cannot be null.")); + } else { + queryPayload.validate(); + } + final String accept = "application/json"; + return service.putSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context); } /** @@ -891,62 +982,13 @@ private Mono> updateWithResponseAsync( } else { queryPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, queryPayload, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Adds or Updates a specific Query within a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param id The id of a specific query defined in the Log Analytics QueryPack. - * @param queryPayload Properties that need to be specified to create a new query and add it to a Log Analytics - * QueryPack. - * @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 Log Analytics QueryPack-Query definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, - String queryPackName, String id, LogAnalyticsQueryPackQueryInner queryPayload, 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - if (queryPayload == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPayload is required and cannot be null.")); - } else { - queryPayload.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - queryPackName, id, apiVersion, queryPayload, accept, context); - } - /** * Adds or Updates a specific Query within a Log Analytics QueryPack. * @@ -984,7 +1026,36 @@ private Mono updateAsync(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) public Response updateWithResponse(String resourceGroupName, String queryPackName, String id, LogAnalyticsQueryPackQueryInner queryPayload, Context context) { - return updateWithResponseAsync(resourceGroupName, queryPackName, id, queryPayload, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (id == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + if (queryPayload == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPayload is required and cannot be null.")); + } else { + queryPayload.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, id, this.client.getApiVersion(), queryPayload, accept, context); } /** @@ -1037,54 +1108,13 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (id == null) { return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, queryPackName, id, apiVersion, accept, context)) + resourceGroupName, queryPackName, id, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes a specific Query defined within an Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param id The id of a specific query defined in the Log Analytics QueryPack. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String queryPackName, String id, - 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (id == null) { - return Mono.error(new IllegalArgumentException("Parameter id is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - queryPackName, id, apiVersion, accept, context); - } - /** * Deletes a specific Query defined within an Log Analytics QueryPack. * @@ -1116,7 +1146,30 @@ private Mono deleteAsync(String resourceGroupName, String queryPackName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String queryPackName, String id, Context context) { - return deleteWithResponseAsync(resourceGroupName, queryPackName, id, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (id == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter id is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + queryPackName, id, this.client.getApiVersion(), accept, context); } /** @@ -1141,8 +1194,8 @@ public void delete(String resourceGroupName, String queryPackName, String id) { * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1160,6 +1213,33 @@ private Mono> listNextSinglePageA .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 a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. * @@ -1168,24 +1248,24 @@ private Mono> listNextSinglePageA * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of Queries defined within a Log Analytics QueryPack along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + 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); } /** @@ -1214,6 +1294,33 @@ private Mono> searchNextSinglePag .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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse searchNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.searchNextSync(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. * @@ -1222,23 +1329,25 @@ private Mono> searchNextSinglePag * @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 describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return describes the list of Log Analytics QueryPack-Query resources along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> searchNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse searchNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.searchNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.searchNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(QueriesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java index eb13f9fc4f9b..3819c5d7c940 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/QueryPacksClientImpl.java @@ -29,6 +29,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.QueryPacksClient; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackListResult; @@ -65,7 +66,7 @@ public final class QueryPacksClientImpl implements QueryPacksClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientQueryPacks") public interface QueryPacksService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/queryPacks") @@ -75,6 +76,14 @@ Mono> list(@HostParam("$host") String @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.OperationalInsights/queryPacks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks") @ExpectedResponses({ 200 }) @@ -83,6 +92,14 @@ Mono> listByResourceGroup(@HostParam(" @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks") @ExpectedResponses({ 201 }) @@ -93,6 +110,16 @@ Mono> createOrUpdateWithoutName(@HostParam( @BodyParam("application/json") LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks") + @ExpectedResponses({ 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateWithoutNameSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") @ExpectedResponses({ 200, 204 }) @@ -102,6 +129,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") @ExpectedResponses({ 200 }) @@ -111,6 +147,15 @@ Mono> getByResourceGroup(@HostParam("$host" @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") @ExpectedResponses({ 200 }) @@ -121,6 +166,16 @@ Mono> createOrUpdate(@HostParam("$host") St @BodyParam("application/json") LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, + @BodyParam("application/json") LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") @ExpectedResponses({ 200 }) @@ -131,6 +186,16 @@ Mono> updateTags(@HostParam("$host") String @BodyParam("application/json") TagsResource queryPackTags, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/queryPacks/{queryPackName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateTagsSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("queryPackName") String queryPackName, + @BodyParam("application/json") TagsResource queryPackTags, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -139,6 +204,14 @@ Mono> listNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") 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("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -146,6 +219,14 @@ Mono> listNext( Mono> listByResourceGroupNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -166,11 +247,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(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())); @@ -179,29 +259,14 @@ private Mono> listSinglePageAsync() { /** * Gets a list of all Log Analytics QueryPacks within a 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 a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of all Log Analytics QueryPacks within a subscription as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -209,12 +274,25 @@ private Mono> listSinglePageAsync(Cont * * @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 of all Log Analytics QueryPacks within a subscription as paginated response with - * {@link PagedFlux}. + * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(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); } /** @@ -224,13 +302,25 @@ private PagedFlux listAsync() { * @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 of all Log Analytics QueryPacks within a subscription as paginated response with - * {@link PagedFlux}. + * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(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); } /** @@ -243,7 +333,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -258,7 +348,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -286,11 +376,10 @@ public PagedIterable list(Context context) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + 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())); @@ -300,36 +389,15 @@ public PagedIterable list(Context context) { * Gets a list of Log Analytics QueryPacks within a resource group. * * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of Log Analytics QueryPacks within a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** @@ -339,12 +407,29 @@ private Mono> listByResourceGroupSingl * @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 of Log Analytics QueryPacks within a resource group as paginated response with {@link PagedFlux}. + * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, 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); } /** @@ -355,12 +440,30 @@ private PagedFlux listByResourceGroupAsync(String re * @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 of Log Analytics QueryPacks within a resource group as paginated response with {@link PagedFlux}. + * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -375,7 +478,8 @@ private PagedFlux listByResourceGroupAsync(String re */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** @@ -391,7 +495,8 @@ public PagedIterable listByResourceGroup(String reso */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** @@ -428,56 +533,14 @@ private Mono> createOrUpdateWithoutNameWith } else { logAnalyticsQueryPackPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdateWithoutName(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Creates a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey nor AppId in - * the Put operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param logAnalyticsQueryPackPayload Properties that need to be specified to create or update a Log Analytics - * QueryPack. - * @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 Log Analytics QueryPack definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithoutNameWithResponseAsync( - String resourceGroupName, LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (logAnalyticsQueryPackPayload == null) { - return Mono.error( - new IllegalArgumentException("Parameter logAnalyticsQueryPackPayload is required and cannot be null.")); - } else { - logAnalyticsQueryPackPayload.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdateWithoutName(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, context); - } - /** * Creates a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey nor AppId in * the Put operation. @@ -513,8 +576,31 @@ private Mono createOrUpdateWithoutNameAsync(String r @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithoutNameWithResponse(String resourceGroupName, LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, Context context) { - return createOrUpdateWithoutNameWithResponseAsync(resourceGroupName, logAnalyticsQueryPackPayload, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (logAnalyticsQueryPackPayload == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter logAnalyticsQueryPackPayload is required and cannot be null.")); + } else { + logAnalyticsQueryPackPayload.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateWithoutNameSync(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), logAnalyticsQueryPackPayload, accept, + context); } /** @@ -563,50 +649,13 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String queryPackName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), - queryPackName, accept, context); - } - /** * Deletes a Log Analytics QueryPack. * @@ -635,7 +684,27 @@ private Mono deleteAsync(String resourceGroupName, String queryPackName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String queryPackName, Context context) { - return deleteWithResponseAsync(resourceGroupName, queryPackName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, accept, context); } /** @@ -681,51 +750,13 @@ private Mono> getByResourceGroupWithRespons if (queryPackName == null) { return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Returns a Log Analytics QueryPack. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @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 Log Analytics QueryPack definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String queryPackName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, accept, context); - } - /** * Returns a Log Analytics QueryPack. * @@ -756,7 +787,27 @@ private Mono getByResourceGroupAsync(String resource @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String queryPackName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, queryPackName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, accept, context); } /** @@ -812,60 +863,14 @@ private Mono> createOrUpdateWithResponseAsy } else { logAnalyticsQueryPackPayload.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, logAnalyticsQueryPackPayload, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), queryPackName, + logAnalyticsQueryPackPayload, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Creates (or updates) a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey - * nor AppId in the Put operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param logAnalyticsQueryPackPayload Properties that need to be specified to create or update a Log Analytics - * QueryPack. - * @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 Log Analytics QueryPack definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String queryPackName, LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (logAnalyticsQueryPackPayload == null) { - return Mono.error( - new IllegalArgumentException("Parameter logAnalyticsQueryPackPayload is required and cannot be null.")); - } else { - logAnalyticsQueryPackPayload.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, logAnalyticsQueryPackPayload, accept, context); - } - /** * Creates (or updates) a Log Analytics QueryPack. Note: You cannot specify a different value for InstrumentationKey * nor AppId in the Put operation. @@ -903,8 +908,34 @@ private Mono createOrUpdateAsync(String resourceGrou @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String queryPackName, LogAnalyticsQueryPackInner logAnalyticsQueryPackPayload, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, queryPackName, logAnalyticsQueryPackPayload, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (logAnalyticsQueryPackPayload == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter logAnalyticsQueryPackPayload is required and cannot be null.")); + } else { + logAnalyticsQueryPackPayload.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, logAnalyticsQueryPackPayload, accept, context); } /** @@ -962,57 +993,14 @@ private Mono> updateTagsWithResponseAsync(S } else { queryPackTags.validate(); } - final String apiVersion = "2019-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context)) + .withContext( + context -> service.updateTags(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Updates an existing QueryPack's tags. To update other fields use the CreateOrUpdate method. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param queryPackName The name of the Log Analytics QueryPack resource. - * @param queryPackTags Updated tag information to set into the QueryPack instance. - * @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 Log Analytics QueryPack definition along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateTagsWithResponseAsync(String resourceGroupName, - String queryPackName, TagsResource queryPackTags, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (queryPackName == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); - } - if (queryPackTags == null) { - return Mono.error(new IllegalArgumentException("Parameter queryPackTags is required and cannot be null.")); - } else { - queryPackTags.validate(); - } - final String apiVersion = "2019-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.updateTags(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context); - } - /** * Updates an existing QueryPack's tags. To update other fields use the CreateOrUpdate method. * @@ -1046,7 +1034,33 @@ private Mono updateTagsAsync(String resourceGroupNam @ServiceMethod(returns = ReturnType.SINGLE) public Response updateTagsWithResponse(String resourceGroupName, String queryPackName, TagsResource queryPackTags, Context context) { - return updateTagsWithResponseAsync(resourceGroupName, queryPackName, queryPackTags, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (queryPackName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackName is required and cannot be null.")); + } + if (queryPackTags == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter queryPackTags is required and cannot be null.")); + } else { + queryPackTags.validate(); + } + final String accept = "application/json"; + return service.updateTagsSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), queryPackName, queryPackTags, accept, context); } /** @@ -1073,8 +1087,8 @@ public LogAnalyticsQueryPackInner updateTags(String resourceGroupName, String qu * @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 describes the list of Log Analytics QueryPack resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1092,6 +1106,33 @@ private Mono> listNextSinglePageAsync( .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 a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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. * @@ -1100,23 +1141,24 @@ private Mono> listNextSinglePageAsync( * @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 describes the list of Log Analytics QueryPack resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of all Log Analytics QueryPacks within a subscription along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + 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); } /** @@ -1126,7 +1168,7 @@ private Mono> listNextSinglePageAsync( * @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 describes the list of Log Analytics QueryPack resources along with {@link PagedResponse} on successful + * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1147,6 +1189,33 @@ private Mono> listByResourceGroupNextS .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 a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(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. * @@ -1155,23 +1224,26 @@ private Mono> listByResourceGroupNextS * @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 describes the list of Log Analytics QueryPack resources along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return a list of Log Analytics QueryPacks within a resource group along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(QueryPacksClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java index 1a5a158e3364..61ddbc7ed65d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SavedSearchesClientImpl.java @@ -24,6 +24,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.SavedSearchesClient; import com.azure.resourcemanager.loganalytics.fluent.models.SavedSearchInner; import com.azure.resourcemanager.loganalytics.fluent.models.SavedSearchesListResultInner; @@ -59,7 +60,7 @@ public final class SavedSearchesClientImpl implements SavedSearchesClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientSavedSearches") public interface SavedSearchesService { @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") @@ -71,6 +72,16 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, + Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") @ExpectedResponses({ 200 }) @@ -82,6 +93,17 @@ Mono> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") SavedSearchInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SavedSearchInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") @ExpectedResponses({ 200 }) @@ -92,6 +114,16 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("savedSearchId") String savedSearchId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches") @ExpectedResponses({ 200 }) @@ -100,6 +132,15 @@ Mono> listByWorkspace(@HostParam("$host") @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -134,52 +175,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (savedSearchId == null) { return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, savedSearchId, apiVersion, context)) + resourceGroupName, workspaceName, savedSearchId, this.client.getApiVersion(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes the specified saved search in a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param savedSearchId The id of the saved search. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String savedSearchId, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (savedSearchId == null) { - return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, savedSearchId, apiVersion, context); - } - /** * Deletes the specified saved search in a given workspace. * @@ -212,7 +213,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String savedSearchId, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, savedSearchId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (savedSearchId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, savedSearchId, this.client.getApiVersion(), context); } /** @@ -269,61 +293,14 @@ private Mono> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, savedSearchId, apiVersion, parameters, accept, context)) + resourceGroupName, workspaceName, savedSearchId, this.client.getApiVersion(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Creates or updates a saved search for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param savedSearchId The id of the saved search. - * @param parameters The parameters required to save a search. - * @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 value object for saved search results along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String savedSearchId, SavedSearchInner parameters, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (savedSearchId == null) { - return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, savedSearchId, apiVersion, parameters, accept, context); - } - /** * Creates or updates a saved search for a given workspace. * @@ -359,8 +336,37 @@ private Mono createOrUpdateAsync(String resourceGroupName, Str @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String savedSearchId, SavedSearchInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, savedSearchId, parameters, context) - .block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (savedSearchId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, savedSearchId, this.client.getApiVersion(), parameters, accept, context); } /** @@ -415,55 +421,13 @@ private Mono> getWithResponseAsync(String resourceGro if (savedSearchId == null) { return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, savedSearchId, apiVersion, accept, context)) + resourceGroupName, workspaceName, savedSearchId, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the specified saved search for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param savedSearchId The id of the saved search. - * @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 specified saved search for a given workspace along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String savedSearchId, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (savedSearchId == null) { - return Mono.error(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - savedSearchId, apiVersion, accept, context); - } - /** * Gets the specified saved search for a given workspace. * @@ -496,7 +460,31 @@ private Mono getAsync(String resourceGroupName, String workspa @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String savedSearchId, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, savedSearchId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (savedSearchId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter savedSearchId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, savedSearchId, this.client.getApiVersion(), accept, context); } /** @@ -544,51 +532,13 @@ private Mono> listByWorkspaceWithResponse return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the saved searches for a given Log Analytics Workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @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 saved searches for a given Log Analytics Workspace along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets the saved searches for a given Log Analytics Workspace. * @@ -619,7 +569,27 @@ private Mono listByWorkspaceAsync(String resourceG @ServiceMethod(returns = ReturnType.SINGLE) public Response listByWorkspaceWithResponse(String resourceGroupName, String workspaceName, Context context) { - return listByWorkspaceWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -636,4 +606,6 @@ public Response listByWorkspaceWithResponse(String public SavedSearchesListResultInner listByWorkspace(String resourceGroupName, String workspaceName) { return listByWorkspaceWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(SavedSearchesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java index e6aa53b15388..9c87a78a57f9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SchemasClientImpl.java @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.SchemasClient; import com.azure.resourcemanager.loganalytics.fluent.models.SearchGetSchemaResponseInner; import reactor.core.publisher.Mono; @@ -54,7 +55,7 @@ public final class SchemasClientImpl implements SchemasClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientSchemas") public interface SchemasService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema") @@ -64,6 +65,15 @@ Mono> get(@HostParam("$host") String endp @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/schema") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -94,50 +104,13 @@ private Mono> getWithResponseAsync(String return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the schema for a given workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @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 schema for a given workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets the schema for a given workspace. * @@ -167,7 +140,27 @@ private Mono getAsync(String resourceGroupName, St @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); } /** @@ -184,4 +177,6 @@ public Response getWithResponse(String resourceGro public SearchGetSchemaResponseInner get(String resourceGroupName, String workspaceName) { return getWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(SchemasClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java index 2eb885fccb49..8604d2311407 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SharedKeysOperationsClientImpl.java @@ -21,6 +21,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.SharedKeysOperationsClient; import com.azure.resourcemanager.loganalytics.fluent.models.SharedKeysInner; import reactor.core.publisher.Mono; @@ -55,7 +56,7 @@ public final class SharedKeysOperationsClientImpl implements SharedKeysOperation * the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientSharedKeysOperations") public interface SharedKeysOperationsService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys") @@ -66,6 +67,15 @@ Mono> getSharedKeys(@HostParam("$host") String endpoin @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSharedKeysSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey") @ExpectedResponses({ 200 }) @@ -74,6 +84,15 @@ Mono> regenerate(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response regenerateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** @@ -104,50 +123,13 @@ private Mono> getSharedKeysWithResponseAsync(String re return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getSharedKeys(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets the shared keys for a workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @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 shared keys for a workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getSharedKeysWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getSharedKeys(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets the shared keys for a workspace. * @@ -178,7 +160,27 @@ private Mono getSharedKeysAsync(String resourceGroupName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public Response getSharedKeysWithResponse(String resourceGroupName, String workspaceName, Context context) { - return getSharedKeysWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSharedKeysSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -225,51 +227,13 @@ private Mono> regenerateWithResponseAsync(String resou if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.regenerate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational - * Insights agents to the workspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @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 shared keys for a workspace along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> regenerateWithResponseAsync(String resourceGroupName, String workspaceName, - 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.regenerate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context); - } - /** * Regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft Operational * Insights agents to the workspace. @@ -302,7 +266,27 @@ private Mono regenerateAsync(String resourceGroupName, String w @ServiceMethod(returns = ReturnType.SINGLE) public Response regenerateWithResponse(String resourceGroupName, String workspaceName, Context context) { - return regenerateWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.regenerateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); } /** @@ -320,4 +304,6 @@ public Response regenerateWithResponse(String resourceGroupName public SharedKeysInner regenerate(String resourceGroupName, String workspaceName) { return regenerateWithResponse(resourceGroupName, workspaceName, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(SharedKeysOperationsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java index 4eb222cb9623..a4c86472e15f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/StorageInsightConfigsClientImpl.java @@ -28,6 +28,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.StorageInsightConfigsClient; import com.azure.resourcemanager.loganalytics.fluent.models.StorageInsightInner; import com.azure.resourcemanager.loganalytics.models.StorageInsightListResult; @@ -63,7 +64,7 @@ public final class StorageInsightConfigsClientImpl implements StorageInsightConf * by the proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientStorageInsightConfigs") public interface StorageInsightConfigsService { @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") @@ -76,6 +77,17 @@ Mono> createOrUpdate(@HostParam("$host") String en @BodyParam("application/json") StorageInsightInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") StorageInsightInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") @ExpectedResponses({ 200 }) @@ -85,6 +97,15 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") @ExpectedResponses({ 200, 204 }) @@ -94,6 +115,15 @@ Mono> delete(@HostParam("$host") String endpoint, @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @PathParam("storageInsightName") String storageInsightName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs") @ExpectedResponses({ 200 }) @@ -103,6 +133,15 @@ Mono> listByWorkspace(@HostParam("$host") Str @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -110,6 +149,14 @@ Mono> listByWorkspace(@HostParam("$host") Str Mono> listByWorkspaceNext( @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -152,62 +199,14 @@ private Mono> createOrUpdateWithResponseAsync(Stri } else { parameters.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - storageInsightName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Create or update a storage insight. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param storageInsightName Name of the storageInsightsConfigs resource. - * @param parameters The parameters required to create or update a storage insight. - * @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 top level storage insight resource container along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String storageInsightName, StorageInsightInner parameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (storageInsightName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageInsightName 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 (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context); - } - /** * Create or update a storage insight. * @@ -243,8 +242,38 @@ private Mono createOrUpdateAsync(String resourceGroupName, @ServiceMethod(returns = ReturnType.SINGLE) public Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, String storageInsightName, StorageInsightInner parameters, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, storageInsightName, parameters, - context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (storageInsightName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageInsightName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, + context); } /** @@ -299,55 +328,13 @@ private Mono> getWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, - storageInsightName, apiVersion, this.client.getSubscriptionId(), accept, context)) + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a storage insight instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param storageInsightName Name of the storageInsightsConfigs resource. - * @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 storage insight instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String storageInsightName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (storageInsightName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageInsightName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets a storage insight instance. * @@ -381,7 +368,31 @@ private Mono getAsync(String resourceGroupName, String work @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String storageInsightName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, storageInsightName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (storageInsightName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageInsightName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -433,53 +444,12 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - storageInsightName, apiVersion, this.client.getSubscriptionId(), context)) + storageInsightName, this.client.getApiVersion(), this.client.getSubscriptionId(), context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Deletes a storageInsightsConfigs resource. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param storageInsightName Name of the storageInsightsConfigs resource. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String storageInsightName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (storageInsightName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageInsightName 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.")); - } - final String apiVersion = "2020-08-01"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, - apiVersion, this.client.getSubscriptionId(), context); - } - /** * Deletes a storageInsightsConfigs resource. * @@ -512,7 +482,30 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String resourceGroupName, String workspaceName, String storageInsightName, Context context) { - return deleteWithResponseAsync(resourceGroupName, workspaceName, storageInsightName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (storageInsightName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageInsightName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, storageInsightName, + this.client.getApiVersion(), this.client.getSubscriptionId(), context); } /** @@ -559,11 +552,10 @@ private Mono> listByWorkspaceSinglePageAsync( return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().odataNextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -574,39 +566,15 @@ private Mono> listByWorkspaceSinglePageAsync( * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @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 list storage insights operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list storage insights operation response as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().odataNextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); } /** @@ -617,12 +585,35 @@ private Mono> listByWorkspaceSinglePageAsync( * @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 list storage insights operation response as paginated response with {@link PagedFlux}. + * @return the list storage insights operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, + String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().odataNextLink(), null); } /** @@ -634,13 +625,35 @@ private PagedFlux listByWorkspaceAsync(String resourceGroup * @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 list storage insights operation response as paginated response with {@link PagedFlux}. + * @return the list storage insights operation response along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context), - nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().odataNextLink(), null); } /** @@ -655,7 +668,8 @@ private PagedFlux listByWorkspaceAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePage(nextLink)); } /** @@ -672,7 +686,8 @@ public PagedIterable listByWorkspace(String resourceGroupNa @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePage(nextLink, context)); } /** @@ -702,6 +717,33 @@ private Mono> listByWorkspaceNextSinglePageAs .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 list storage insights operation response along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().odataNextLink(), null); + } + /** * Get the next page of items. * @@ -710,23 +752,25 @@ private Mono> listByWorkspaceNextSinglePageAs * @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 list storage insights operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the list storage insights operation response along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listByWorkspaceNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().odataNextLink(), null)); + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().odataNextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(StorageInsightConfigsClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsImpl.java new file mode 100644 index 000000000000..90ba126a1301 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsImpl.java @@ -0,0 +1,199 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; +import com.azure.resourcemanager.loganalytics.models.ProvisioningStateEnum; +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import com.azure.resourcemanager.loganalytics.models.StatusCodeEnum; +import com.azure.resourcemanager.loganalytics.models.SummaryLogs; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; + +public final class SummaryLogsImpl implements SummaryLogs, SummaryLogs.Definition, SummaryLogs.Update { + private SummaryLogsInner innerObject; + + private final com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager; + + public String id() { + return this.innerModel().id(); + } + + public String name() { + return this.innerModel().name(); + } + + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public RuleTypeEnum ruleType() { + return this.innerModel().ruleType(); + } + + public String displayName() { + return this.innerModel().displayName(); + } + + public String description() { + return this.innerModel().description(); + } + + public Boolean isActive() { + return this.innerModel().isActive(); + } + + public StatusCodeEnum statusCode() { + return this.innerModel().statusCode(); + } + + public ProvisioningStateEnum provisioningState() { + return this.innerModel().provisioningState(); + } + + public RuleDefinition ruleDefinition() { + return this.innerModel().ruleDefinition(); + } + + public String resourceGroupName() { + return resourceGroupName; + } + + public SummaryLogsInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager() { + return this.serviceManager; + } + + private String resourceGroupName; + + private String workspaceName; + + private String summaryLogsName; + + public SummaryLogsImpl withExistingWorkspace(String resourceGroupName, String workspaceName) { + this.resourceGroupName = resourceGroupName; + this.workspaceName = workspaceName; + return this; + } + + public SummaryLogs create() { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .createOrUpdate(resourceGroupName, workspaceName, summaryLogsName, this.innerModel(), Context.NONE); + return this; + } + + public SummaryLogs create(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .createOrUpdate(resourceGroupName, workspaceName, summaryLogsName, this.innerModel(), context); + return this; + } + + SummaryLogsImpl(String name, com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { + this.innerObject = new SummaryLogsInner(); + this.serviceManager = serviceManager; + this.summaryLogsName = name; + } + + public SummaryLogsImpl update() { + return this; + } + + public SummaryLogs apply() { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .createOrUpdate(resourceGroupName, workspaceName, summaryLogsName, this.innerModel(), Context.NONE); + return this; + } + + public SummaryLogs apply(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .createOrUpdate(resourceGroupName, workspaceName, summaryLogsName, this.innerModel(), context); + return this; + } + + SummaryLogsImpl(SummaryLogsInner innerObject, + com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + this.resourceGroupName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "resourceGroups"); + this.workspaceName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "workspaces"); + this.summaryLogsName = ResourceManagerUtils.getValueFromIdByName(innerObject.id(), "summaryLogs"); + } + + public SummaryLogs refresh() { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .getWithResponse(resourceGroupName, workspaceName, summaryLogsName, Context.NONE) + .getValue(); + return this; + } + + public SummaryLogs refresh(Context context) { + this.innerObject = serviceManager.serviceClient() + .getSummaryLogsOperations() + .getWithResponse(resourceGroupName, workspaceName, summaryLogsName, context) + .getValue(); + return this; + } + + public void start() { + serviceManager.summaryLogsOperations().start(resourceGroupName, workspaceName, summaryLogsName); + } + + public void start(Context context) { + serviceManager.summaryLogsOperations().start(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public Response stopWithResponse(Context context) { + return serviceManager.summaryLogsOperations() + .stopWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public void stop() { + serviceManager.summaryLogsOperations().stop(resourceGroupName, workspaceName, summaryLogsName); + } + + public void retryBin(SummaryLogsRetryBin parameters) { + serviceManager.summaryLogsOperations().retryBin(resourceGroupName, workspaceName, summaryLogsName, parameters); + } + + public void retryBin(SummaryLogsRetryBin parameters, Context context) { + serviceManager.summaryLogsOperations() + .retryBin(resourceGroupName, workspaceName, summaryLogsName, parameters, context); + } + + public SummaryLogsImpl withRuleType(RuleTypeEnum ruleType) { + this.innerModel().withRuleType(ruleType); + return this; + } + + public SummaryLogsImpl withDisplayName(String displayName) { + this.innerModel().withDisplayName(displayName); + return this; + } + + public SummaryLogsImpl withDescription(String description) { + this.innerModel().withDescription(description); + return this; + } + + public SummaryLogsImpl withRuleDefinition(RuleDefinition ruleDefinition) { + this.innerModel().withRuleDefinition(ruleDefinition); + return this; + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsClientImpl.java new file mode 100644 index 000000000000..b6c151f4e68e --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsClientImpl.java @@ -0,0 +1,1698 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.loganalytics.fluent.SummaryLogsOperationsClient; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsListResult; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; +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 SummaryLogsOperationsClient. + */ +public final class SummaryLogsOperationsClientImpl implements SummaryLogsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final SummaryLogsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final OperationalInsightsManagementClientImpl client; + + /** + * Initializes an instance of SummaryLogsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SummaryLogsOperationsClientImpl(OperationalInsightsManagementClientImpl client) { + this.service = RestProxy.create(SummaryLogsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for OperationalInsightsManagementClientSummaryLogsOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "OperationalInsightsManagementClientSummaryLogsOperations") + public interface SummaryLogsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspace(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @BodyParam("application/json") SummaryLogsInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @BodyParam("application/json") SummaryLogsInner parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/start") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/start") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response startSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/stop") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> stop(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/stop") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response stopSync(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/retrybin") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> retryBin(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @BodyParam("application/json") SummaryLogsRetryBin parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/summaryLogs/{summaryLogsName}/retrybin") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response retryBinSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("summaryLogsName") String summaryLogsName, + @BodyParam("application/json") SummaryLogsRetryBin parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByWorkspaceNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, + String workspaceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), 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 all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePageAsync(nextLink)); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName), + nextLink -> listByWorkspaceNextSinglePage(nextLink)); + } + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, + Context context) { + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listByWorkspaceNextSinglePage(nextLink, context)); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner parameters) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsInner parameters) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, Context.NONE); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, context); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, SummaryLogsInner> beginCreateOrUpdateAsync( + String resourceGroupName, String workspaceName, String summaryLogsName, SummaryLogsInner parameters) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + SummaryLogsInner.class, SummaryLogsInner.class, this.client.getContext()); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SummaryLogsInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner parameters) { + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, summaryLogsName, parameters); + return this.client.getLroResult(response, SummaryLogsInner.class, + SummaryLogsInner.class, Context.NONE); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, SummaryLogsInner> beginCreateOrUpdate(String resourceGroupName, + String workspaceName, String summaryLogsName, SummaryLogsInner parameters, Context context) { + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, summaryLogsName, parameters, context); + return this.client.getLroResult(response, SummaryLogsInner.class, + SummaryLogsInner.class, context); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsInner parameters) { + return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, summaryLogsName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SummaryLogsInner createOrUpdate(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsInner parameters) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, summaryLogsName, parameters).getFinalResult(); + } + + /** + * Creates or updates Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to update summary rules properties. + * @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 workspace data summary rules definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SummaryLogsInner createOrUpdate(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsInner parameters, Context context) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, summaryLogsName, parameters, context) + .getFinalResult(); + } + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getAsync(String resourceGroupName, String workspaceName, String summaryLogsName) { + return getWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context); + } + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public SummaryLogsInner get(String resourceGroupName, String workspaceName, String summaryLogsName) { + return getWithResponse(resourceGroupName, workspaceName, summaryLogsName, Context.NONE).getValue(); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 resourceGroupName, String workspaceName, + String summaryLogsName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 deleteWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, Context.NONE); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 deleteWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginDeleteAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginDelete(String resourceGroupName, String workspaceName, + String summaryLogsName) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, summaryLogsName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginDelete(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 resourceGroupName, String workspaceName, String summaryLogsName) { + return beginDeleteAsync(resourceGroupName, workspaceName, summaryLogsName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 resourceGroupName, String workspaceName, String summaryLogsName) { + beginDelete(resourceGroupName, workspaceName, summaryLogsName).getFinalResult(); + } + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 delete(String resourceGroupName, String workspaceName, String summaryLogsName, Context context) { + beginDelete(resourceGroupName, workspaceName, summaryLogsName, context).getFinalResult(); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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>> startWithResponseAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 startWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, Context.NONE); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 startWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.startSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginStartAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + Mono>> mono + = startWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginStart(String resourceGroupName, String workspaceName, + String summaryLogsName) { + Response response = startWithResponse(resourceGroupName, workspaceName, summaryLogsName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> beginStart(String resourceGroupName, String workspaceName, + String summaryLogsName, Context context) { + Response response = startWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 startAsync(String resourceGroupName, String workspaceName, String summaryLogsName) { + return beginStartAsync(resourceGroupName, workspaceName, summaryLogsName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 start(String resourceGroupName, String workspaceName, String summaryLogsName) { + beginStart(resourceGroupName, workspaceName, summaryLogsName).getFinalResult(); + } + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 start(String resourceGroupName, String workspaceName, String summaryLogsName, Context context) { + beginStart(resourceGroupName, workspaceName, summaryLogsName, context).getFinalResult(); + } + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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> stopWithResponseAsync(String resourceGroupName, String workspaceName, + String summaryLogsName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.stop(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 stopAsync(String resourceGroupName, String workspaceName, String summaryLogsName) { + return stopWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName) + .flatMap(ignored -> Mono.empty()); + } + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 stopWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.stopSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, accept, context); + } + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 stop(String resourceGroupName, String workspaceName, String summaryLogsName) { + stopWithResponse(resourceGroupName, workspaceName, summaryLogsName, Context.NONE); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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>> retryBinWithResponseAsync(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.retryBin(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBinWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.retryBinSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, Context.NONE); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBinWithResponse(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (summaryLogsName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter summaryLogsName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.retryBinSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), summaryLogsName, parameters, accept, context); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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> beginRetryBinAsync(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters) { + Mono>> mono + = retryBinWithResponseAsync(resourceGroupName, workspaceName, summaryLogsName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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> beginRetryBin(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters) { + Response response + = retryBinWithResponse(resourceGroupName, workspaceName, summaryLogsName, parameters); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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> beginRetryBin(String resourceGroupName, String workspaceName, + String summaryLogsName, SummaryLogsRetryBin parameters, Context context) { + Response response + = retryBinWithResponse(resourceGroupName, workspaceName, summaryLogsName, parameters, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBinAsync(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters) { + return beginRetryBinAsync(resourceGroupName, workspaceName, summaryLogsName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters) { + beginRetryBin(resourceGroupName, workspaceName, summaryLogsName, parameters).getFinalResult(); + } + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters, Context context) { + beginRetryBin(resourceGroupName, workspaceName, summaryLogsName, parameters, 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 all summary rules for the specified Log Analytics workspace along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByWorkspaceNextSinglePageAsync(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.listByWorkspaceNext(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 all summary rules for the specified Log Analytics workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(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 all summary rules for the specified Log Analytics workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(SummaryLogsOperationsClientImpl.class); +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsImpl.java new file mode 100644 index 000000000000..e3bc565e8dab --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/SummaryLogsOperationsImpl.java @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.loganalytics.fluent.SummaryLogsOperationsClient; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; +import com.azure.resourcemanager.loganalytics.models.SummaryLogs; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsOperations; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; + +public final class SummaryLogsOperationsImpl implements SummaryLogsOperations { + private static final ClientLogger LOGGER = new ClientLogger(SummaryLogsOperationsImpl.class); + + private final SummaryLogsOperationsClient innerClient; + + private final com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager; + + public SummaryLogsOperationsImpl(SummaryLogsOperationsClient innerClient, + com.azure.resourcemanager.loganalytics.LogAnalyticsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { + PagedIterable inner = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SummaryLogsImpl(inner1, this.manager())); + } + + public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { + PagedIterable inner + = this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new SummaryLogsImpl(inner1, this.manager())); + } + + public Response getWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context) { + Response inner + = this.serviceClient().getWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new SummaryLogsImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public SummaryLogs get(String resourceGroupName, String workspaceName, String summaryLogsName) { + SummaryLogsInner inner = this.serviceClient().get(resourceGroupName, workspaceName, summaryLogsName); + if (inner != null) { + return new SummaryLogsImpl(inner, this.manager()); + } else { + return null; + } + } + + public void delete(String resourceGroupName, String workspaceName, String summaryLogsName) { + this.serviceClient().delete(resourceGroupName, workspaceName, summaryLogsName); + } + + public void delete(String resourceGroupName, String workspaceName, String summaryLogsName, Context context) { + this.serviceClient().delete(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public void start(String resourceGroupName, String workspaceName, String summaryLogsName) { + this.serviceClient().start(resourceGroupName, workspaceName, summaryLogsName); + } + + public void start(String resourceGroupName, String workspaceName, String summaryLogsName, Context context) { + this.serviceClient().start(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public Response stopWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context) { + return this.serviceClient().stopWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public void stop(String resourceGroupName, String workspaceName, String summaryLogsName) { + this.serviceClient().stop(resourceGroupName, workspaceName, summaryLogsName); + } + + public void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters) { + this.serviceClient().retryBin(resourceGroupName, workspaceName, summaryLogsName, parameters); + } + + public void retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters, Context context) { + this.serviceClient().retryBin(resourceGroupName, workspaceName, summaryLogsName, parameters, context); + } + + public SummaryLogs 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 workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String summaryLogsName = ResourceManagerUtils.getValueFromIdByName(id, "summaryLogs"); + if (summaryLogsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'summaryLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, summaryLogsName, 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 workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String summaryLogsName = ResourceManagerUtils.getValueFromIdByName(id, "summaryLogs"); + if (summaryLogsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'summaryLogs'.", id))); + } + return this.getWithResponse(resourceGroupName, workspaceName, summaryLogsName, context); + } + + public void deleteById(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 workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String summaryLogsName = ResourceManagerUtils.getValueFromIdByName(id, "summaryLogs"); + if (summaryLogsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'summaryLogs'.", id))); + } + this.delete(resourceGroupName, workspaceName, summaryLogsName, Context.NONE); + } + + public void deleteByIdWithResponse(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 workspaceName = ResourceManagerUtils.getValueFromIdByName(id, "workspaces"); + if (workspaceName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id))); + } + String summaryLogsName = ResourceManagerUtils.getValueFromIdByName(id, "summaryLogs"); + if (summaryLogsName == null) { + throw LOGGER.logExceptionAsError(new IllegalArgumentException( + String.format("The resource ID '%s' is not valid. Missing path segment 'summaryLogs'.", id))); + } + this.delete(resourceGroupName, workspaceName, summaryLogsName, context); + } + + private SummaryLogsOperationsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager() { + return this.serviceManager; + } + + public SummaryLogsImpl define(String name) { + return new SummaryLogsImpl(name, this.manager()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java index 7f0a3bcb785a..743c54e03a5c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TableImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.implementation; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; import com.azure.resourcemanager.loganalytics.models.ProvisioningStateEnum; @@ -12,7 +13,6 @@ import com.azure.resourcemanager.loganalytics.models.ResultStatistics; import com.azure.resourcemanager.loganalytics.models.Schema; import com.azure.resourcemanager.loganalytics.models.SearchResults; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.Table; import com.azure.resourcemanager.loganalytics.models.TablePlanEnum; @@ -33,7 +33,7 @@ public String type() { return this.innerModel().type(); } - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.innerModel().systemData(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java index 1762c5ef174c..9206cb6e51a1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/TablesClientImpl.java @@ -29,8 +29,10 @@ 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.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.loganalytics.fluent.TablesClient; @@ -69,7 +71,7 @@ public final class TablesClientImpl implements TablesClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientTables") public interface TablesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables") @@ -80,6 +82,15 @@ Mono> listByWorkspace(@HostParam("$host") String endp @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByWorkspaceSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") @ExpectedResponses({ 200, 202 }) @@ -91,6 +102,17 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") TableInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, + @BodyParam("application/json") TableInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") @ExpectedResponses({ 200, 202 }) @@ -102,6 +124,17 @@ Mono>> update(@HostParam("$host") String endpoint, @BodyParam("application/json") TableInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, + @BodyParam("application/json") TableInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") @ExpectedResponses({ 200 }) @@ -112,6 +145,16 @@ Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") @ExpectedResponses({ 200, 202, 204 }) @@ -122,6 +165,16 @@ Mono>> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate") @ExpectedResponses({ 200 }) @@ -132,6 +185,16 @@ Mono> migrate(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/migrate") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response migrateSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/cancelSearch") @ExpectedResponses({ 200 }) @@ -141,6 +204,16 @@ Mono> cancelSearch(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}/cancelSearch") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response cancelSearchSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("tableName") String tableName, + @HeaderParam("Accept") String accept, Context context); } /** @@ -172,11 +245,10 @@ private Mono> listByWorkspaceSinglePageAsync(String re if (workspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -187,39 +259,14 @@ private Mono> listByWorkspaceSinglePageAsync(String re * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @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 all the tables for the specified Log Analytics workspace along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return all the tables for the specified Log Analytics workspace as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByWorkspaceSinglePageAsync(String resourceGroupName, - String workspaceName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByWorkspace(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -230,11 +277,34 @@ private Mono> listByWorkspaceSinglePageAsync(String re * @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 all the tables for the specified Log Analytics workspace as paginated response with {@link PagedFlux}. + * @return all the tables for the specified Log Analytics workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -246,12 +316,35 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName, Str * @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 all the tables for the specified Log Analytics workspace as paginated response with {@link PagedFlux}. + * @return all the tables for the specified Log Analytics workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName, + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByWorkspaceSinglePage(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, context)); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByWorkspaceSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -267,7 +360,7 @@ private PagedFlux listByWorkspaceAsync(String resourceGroupName, Str */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName)); } /** @@ -284,7 +377,7 @@ public PagedIterable listByWorkspace(String resourceGroupName, Strin */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listByWorkspaceAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listByWorkspaceSinglePage(resourceGroupName, workspaceName, context)); } /** @@ -325,11 +418,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, parameters, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -340,43 +432,45 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param workspaceName The name of the workspace. * @param tableName The name of the table. * @param parameters The parameters required to update table properties. - * @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 workspace data table definition along with {@link Response} on successful completion of {@link Mono}. + * @return workspace data table definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String tableName, TableInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, Context.NONE); } /** @@ -386,18 +480,46 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param workspaceName The name of the workspace. * @param tableName The name of the table. * @param parameters The parameters required to update table properties. + * @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 PollerFlux} for polling of workspace data table definition. + * @return workspace data table definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TableInner> beginCreateOrUpdateAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), TableInner.class, - TableInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + String tableName, TableInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context); } /** @@ -407,7 +529,6 @@ private PollerFlux, TableInner> beginCreateOrUpdateAsync( * @param workspaceName The name of the workspace. * @param tableName The name of the table. * @param parameters The parameters required to update table properties. - * @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. @@ -415,12 +536,11 @@ private PollerFlux, TableInner> beginCreateOrUpdateAsync( */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, TableInner> beginCreateOrUpdateAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters, Context context) { - context = this.client.mergeContext(context); + String workspaceName, String tableName, TableInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), TableInner.class, - TableInner.class, context); + TableInner.class, this.client.getContext()); } /** @@ -438,7 +558,10 @@ private PollerFlux, TableInner> beginCreateOrUpdateAsync( @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TableInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, tableName, parameters); + return this.client.getLroResult(response, TableInner.class, TableInner.class, + Context.NONE); } /** @@ -457,8 +580,9 @@ public SyncPoller, TableInner> beginCreateOrUpdate(String @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TableInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context) - .getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, tableName, parameters, context); + return this.client.getLroResult(response, TableInner.class, TableInner.class, context); } /** @@ -480,26 +604,6 @@ private Mono createOrUpdateAsync(String resourceGroupName, String wo .flatMap(this.client::getLroFinalResultOrError); } - /** - * Update or Create a Log Analytics workspace table. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param tableName The name of the table. - * @param parameters The parameters required to update table properties. - * @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 workspace data table definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, String tableName, - TableInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Update or Create a Log Analytics workspace table. * @@ -515,7 +619,7 @@ private Mono createOrUpdateAsync(String resourceGroupName, String wo @ServiceMethod(returns = ReturnType.SINGLE) public TableInner createOrUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { - return createOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).block(); + return beginCreateOrUpdate(resourceGroupName, workspaceName, tableName, parameters).getFinalResult(); } /** @@ -534,7 +638,7 @@ public TableInner createOrUpdate(String resourceGroupName, String workspaceName, @ServiceMethod(returns = ReturnType.SINGLE) public TableInner createOrUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { - return createOrUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context).block(); + return beginCreateOrUpdate(resourceGroupName, workspaceName, tableName, parameters, context).getFinalResult(); } /** @@ -575,11 +679,10 @@ private Mono>> updateWithResponseAsync(String resource } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, parameters, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -590,43 +693,45 @@ private Mono>> updateWithResponseAsync(String resource * @param workspaceName The name of the workspace. * @param tableName The name of the table. * @param parameters The parameters required to update table properties. - * @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 workspace data table definition along with {@link Response} on successful completion of {@link Mono}. + * @return workspace data table definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, TableInner parameters, Context context) { + private Response updateWithResponse(String resourceGroupName, String workspaceName, String tableName, + TableInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, Context.NONE); } /** @@ -636,18 +741,46 @@ private Mono>> updateWithResponseAsync(String resource * @param workspaceName The name of the workspace. * @param tableName The name of the table. * @param parameters The parameters required to update table properties. + * @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 PollerFlux} for polling of workspace data table definition. + * @return workspace data table definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TableInner> beginUpdateAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), TableInner.class, - TableInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String workspaceName, String tableName, + TableInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, parameters, accept, context); } /** @@ -657,7 +790,6 @@ private PollerFlux, TableInner> beginUpdateAsync(String r * @param workspaceName The name of the workspace. * @param tableName The name of the table. * @param parameters The parameters required to update table properties. - * @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. @@ -665,12 +797,11 @@ private PollerFlux, TableInner> beginUpdateAsync(String r */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, TableInner> beginUpdateAsync(String resourceGroupName, - String workspaceName, String tableName, TableInner parameters, Context context) { - context = this.client.mergeContext(context); + String workspaceName, String tableName, TableInner parameters) { Mono>> mono - = updateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters, context); + = updateWithResponseAsync(resourceGroupName, workspaceName, tableName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), TableInner.class, - TableInner.class, context); + TableInner.class, this.client.getContext()); } /** @@ -688,7 +819,9 @@ private PollerFlux, TableInner> beginUpdateAsync(String r @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TableInner> beginUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { - return this.beginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters).getSyncPoller(); + Response response = updateWithResponse(resourceGroupName, workspaceName, tableName, parameters); + return this.client.getLroResult(response, TableInner.class, TableInner.class, + Context.NONE); } /** @@ -707,7 +840,9 @@ public SyncPoller, TableInner> beginUpdate(String resourc @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, TableInner> beginUpdate(String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context).getSyncPoller(); + Response response + = updateWithResponse(resourceGroupName, workspaceName, tableName, parameters, context); + return this.client.getLroResult(response, TableInner.class, TableInner.class, context); } /** @@ -729,26 +864,6 @@ private Mono updateAsync(String resourceGroupName, String workspaceN .flatMap(this.client::getLroFinalResultOrError); } - /** - * Update a Log Analytics workspace table. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param tableName The name of the table. - * @param parameters The parameters required to update table properties. - * @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 workspace data table definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String workspaceName, String tableName, - TableInner parameters, Context context) { - return beginUpdateAsync(resourceGroupName, workspaceName, tableName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Update a Log Analytics workspace table. * @@ -763,7 +878,7 @@ private Mono updateAsync(String resourceGroupName, String workspaceN */ @ServiceMethod(returns = ReturnType.SINGLE) public TableInner update(String resourceGroupName, String workspaceName, String tableName, TableInner parameters) { - return updateAsync(resourceGroupName, workspaceName, tableName, parameters).block(); + return beginUpdate(resourceGroupName, workspaceName, tableName, parameters).getFinalResult(); } /** @@ -782,7 +897,7 @@ public TableInner update(String resourceGroupName, String workspaceName, String @ServiceMethod(returns = ReturnType.SINGLE) public TableInner update(String resourceGroupName, String workspaceName, String tableName, TableInner parameters, Context context) { - return updateAsync(resourceGroupName, workspaceName, tableName, parameters, context).block(); + return beginUpdate(resourceGroupName, workspaceName, tableName, parameters, context).getFinalResult(); } /** @@ -817,54 +932,13 @@ private Mono> getWithResponseAsync(String resourceGroupName if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a Log Analytics workspace table. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param tableName The name of the table. - * @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 Log Analytics workspace table along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, workspaceName, - apiVersion, tableName, accept, context); - } - /** * Gets a Log Analytics workspace table. * @@ -897,7 +971,31 @@ private Mono getAsync(String resourceGroupName, String workspaceName @ServiceMethod(returns = ReturnType.SINGLE) public Response getWithResponse(String resourceGroupName, String workspaceName, String tableName, Context context) { - return getWithResponseAsync(resourceGroupName, workspaceName, tableName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -948,11 +1046,10 @@ private Mono>> deleteWithResponseAsync(String resource if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -962,38 +1059,38 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param tableName The name of the table. - * @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} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, Context context) { + private Response deleteWithResponse(String resourceGroupName, String workspaceName, String tableName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); } if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, Context.NONE); } /** @@ -1002,17 +1099,40 @@ private Mono>> deleteWithResponseAsync(String resource * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param tableName The name of the table. + * @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 PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, - String tableName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, tableName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String workspaceName, String tableName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -1021,7 +1141,6 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param tableName The name of the table. - * @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. @@ -1029,12 +1148,10 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, - String tableName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, workspaceName, tableName, context); + String tableName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, workspaceName, tableName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -1051,7 +1168,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String tableName) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, tableName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, tableName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -1069,7 +1187,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, String tableName, Context context) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, tableName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, tableName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -1089,24 +1208,6 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete a Log Analytics workspace table. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param tableName The name of the table. - * @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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, String tableName, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, tableName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete a Log Analytics workspace table. * @@ -1119,7 +1220,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, S */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName, String tableName) { - deleteAsync(resourceGroupName, workspaceName, tableName).block(); + beginDelete(resourceGroupName, workspaceName, tableName).getFinalResult(); } /** @@ -1135,7 +1236,7 @@ public void delete(String resourceGroupName, String workspaceName, String tableN */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName, String tableName, Context context) { - deleteAsync(resourceGroupName, workspaceName, tableName, context).block(); + beginDelete(resourceGroupName, workspaceName, tableName, context).getFinalResult(); } /** @@ -1171,55 +1272,13 @@ private Mono> migrateWithResponseAsync(String resourceGroupName, if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.migrate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Migrate a Log Analytics table from support of the Data Collector API and Custom Fields features to support of - * Data Collection Rule-based Custom Logs. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param tableName The name of the table. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> migrateWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.migrate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, accept, context); - } - /** * Migrate a Log Analytics table from support of the Data Collector API and Custom Fields features to support of * Data Collection Rule-based Custom Logs. @@ -1253,7 +1312,31 @@ private Mono migrateAsync(String resourceGroupName, String workspaceName, @ServiceMethod(returns = ReturnType.SINGLE) public Response migrateWithResponse(String resourceGroupName, String workspaceName, String tableName, Context context) { - return migrateWithResponseAsync(resourceGroupName, workspaceName, tableName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.migrateSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -1304,54 +1387,13 @@ private Mono> cancelSearchWithResponseAsync(String resourceGroupN if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.cancelSearch(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, workspaceName, apiVersion, tableName, accept, context)) + resourceGroupName, workspaceName, this.client.getApiVersion(), tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Cancel a log analytics workspace search results table query run. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param tableName The name of the table. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelSearchWithResponseAsync(String resourceGroupName, String workspaceName, - String tableName, 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cancelSearch(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - workspaceName, apiVersion, tableName, accept, context); - } - /** * Cancel a log analytics workspace search results table query run. * @@ -1384,7 +1426,31 @@ private Mono cancelSearchAsync(String resourceGroupName, String workspaceN @ServiceMethod(returns = ReturnType.SINGLE) public Response cancelSearchWithResponse(String resourceGroupName, String workspaceName, String tableName, Context context) { - return cancelSearchWithResponseAsync(resourceGroupName, workspaceName, tableName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (tableName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.cancelSearchSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), tableName, accept, context); } /** @@ -1401,4 +1467,6 @@ public Response cancelSearchWithResponse(String resourceGroupName, String public void cancelSearch(String resourceGroupName, String workspaceName, String tableName) { cancelSearchWithResponse(resourceGroupName, workspaceName, tableName, Context.NONE); } + + private static final ClientLogger LOGGER = new ClientLogger(TablesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java index 82068fd4360d..73b583fbb460 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/UsagesClientImpl.java @@ -25,6 +25,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.UsagesClient; import com.azure.resourcemanager.loganalytics.fluent.models.UsageMetricInner; import com.azure.resourcemanager.loganalytics.models.WorkspaceListUsagesResult; @@ -59,7 +60,7 @@ public final class UsagesClientImpl implements UsagesClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientUsages") public interface UsagesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages") @@ -69,6 +70,15 @@ Mono> list(@HostParam("$host") String endpoi @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); } /** @@ -99,11 +109,10 @@ private Mono> listSinglePageAsync(String resourc return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -114,39 +123,14 @@ private Mono> listSinglePageAsync(String resourc * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @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 of usage metrics for a workspace along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return a list of usage metrics for a workspace as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String workspaceName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String workspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName)); } /** @@ -157,11 +141,33 @@ private Mono> listSinglePageAsync(String resourc * @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 of usage metrics for a workspace as paginated response with {@link PagedFlux}. + * @return a list of usage metrics for a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, + workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -173,11 +179,34 @@ private PagedFlux listAsync(String resourceGroupName, String w * @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 of usage metrics for a workspace as paginated response with {@link PagedFlux}. + * @return a list of usage metrics for a workspace along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String workspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, workspaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(String resourceGroupName, String workspaceName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), resourceGroupName, + workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -192,7 +221,7 @@ private PagedFlux listAsync(String resourceGroupName, String w */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName)); } /** @@ -208,6 +237,8 @@ public PagedIterable list(String resourceGroupName, String wor */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(String resourceGroupName, String workspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, workspaceName, context)); + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, workspaceName, context)); } + + private static final ClientLogger LOGGER = new ClientLogger(UsagesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java index b2ea3cb7253e..e140e047d854 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspaceImpl.java @@ -5,18 +5,21 @@ package com.azure.resourcemanager.loganalytics.implementation; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.PrivateLinkScopedResource; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; import com.azure.resourcemanager.loganalytics.models.Workspace; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; import com.azure.resourcemanager.loganalytics.models.WorkspaceEntityStatus; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.List; import java.util.Map; @@ -55,7 +58,7 @@ public Identity identity() { return this.innerModel().identity(); } - public SystemDataAutoGenerated systemData() { + public SystemData systemData() { return this.innerModel().systemData(); } @@ -83,11 +86,11 @@ public WorkspaceCapping workspaceCapping() { return this.innerModel().workspaceCapping(); } - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerModel().createdDate(); } - public String modifiedDate() { + public OffsetDateTime modifiedDate() { return this.innerModel().modifiedDate(); } @@ -120,6 +123,14 @@ public String defaultDataCollectionRuleResourceId() { return this.innerModel().defaultDataCollectionRuleResourceId(); } + public WorkspaceReplicationProperties replication() { + return this.innerModel().replication(); + } + + public WorkspaceFailoverProperties failover() { + return this.innerModel().failover(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -331,7 +342,27 @@ public WorkspaceImpl withDefaultDataCollectionRuleResourceId(String defaultDataC } } + public WorkspaceImpl withReplication(WorkspaceReplicationProperties replication) { + if (isInCreateMode()) { + this.innerModel().withReplication(replication); + return this; + } else { + this.updateParameters.withReplication(replication); + return this; + } + } + + public WorkspaceImpl withFailover(WorkspaceFailoverProperties failover) { + if (isInCreateMode()) { + this.innerModel().withFailover(failover); + return this; + } else { + this.updateParameters.withFailover(failover); + return this; + } + } + private boolean isInCreateMode() { - return this.innerModel().id() == null; + return this.innerModel() == null || this.innerModel().id() == null; } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java index 9f03aae1ad81..5fc531cba2ee 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacePurgesClientImpl.java @@ -23,6 +23,7 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.WorkspacePurgesClient; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspacePurgeResponseInner; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspacePurgeStatusResponseInner; @@ -60,7 +61,7 @@ public final class WorkspacePurgesClientImpl implements WorkspacePurgesClient { * proxy service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientWorkspacePurges") public interface WorkspacePurgesService { @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge") @@ -72,6 +73,16 @@ Mono purge(@HostParam("$host") String endpoint, @BodyParam("application/json") WorkspacePurgeBody body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/purge") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + WorkspacePurgesPurgeResponse purgeSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, + @BodyParam("application/json") WorkspacePurgeBody body, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}") @ExpectedResponses({ 200 }) @@ -80,6 +91,15 @@ Mono> getPurgeStatus(@HostParam("$ho @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, @PathParam("purgeId") String purgeId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getPurgeStatusSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("workspaceName") String workspaceName, + @PathParam("purgeId") String purgeId, @HeaderParam("Accept") String accept, Context context); } /** @@ -124,64 +144,13 @@ private Mono purgeWithResponseAsync(String resourc } else { body.validate(); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.purge(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), workspaceName, body, accept, context)) + .withContext(context -> service.purge(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Purges data in an Log Analytics workspace by a set of user-defined filters. - * - * In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the - * execution of purge requests by sending a single command whose predicate includes all user identities that require - * purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge - * request to verify that the results are expected. - * Log Analytics only supports purge operations required for compliance with GDPR. The Log Analytics product team - * reserves the right to reject requests for purge operations that are not for the purpose of GDPR compliance. In - * the event of a dispute, please create a support ticket. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param body Describes the body of a request to purge data in a single table of an Log Analytics Workspace. - * @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 response containing operationId for a specific purge action on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono purgeWithResponseAsync(String resourceGroupName, String workspaceName, - WorkspacePurgeBody body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.purge(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), - workspaceName, body, accept, context); - } - /** * Purges data in an Log Analytics workspace by a set of user-defined filters. * @@ -231,7 +200,32 @@ private Mono purgeAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public WorkspacePurgesPurgeResponse purgeWithResponse(String resourceGroupName, String workspaceName, WorkspacePurgeBody body, Context context) { - return purgeWithResponseAsync(resourceGroupName, workspaceName, body, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.purgeSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), workspaceName, body, accept, context); } /** @@ -291,55 +285,13 @@ private Mono> getPurgeStatusWithResp if (purgeId == null) { return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); } - final String apiVersion = "2020-08-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), workspaceName, purgeId, accept, context)) + .withContext(context -> service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, + this.client.getApiVersion(), this.client.getSubscriptionId(), workspaceName, purgeId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets status of an ongoing purge operation. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param purgeId In a purge status request, this is the Id of the operation the status of which is returned. - * @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 status of an ongoing purge operation along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getPurgeStatusWithResponseAsync(String resourceGroupName, - String workspaceName, String purgeId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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 (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); - } - if (purgeId == null) { - return Mono.error(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); - } - final String apiVersion = "2020-08-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getPurgeStatus(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), workspaceName, purgeId, accept, context); - } - /** * Gets status of an ongoing purge operation. * @@ -373,7 +325,31 @@ private Mono getPurgeStatusAsync(String resou @ServiceMethod(returns = ReturnType.SINGLE) public Response getPurgeStatusWithResponse(String resourceGroupName, String workspaceName, String purgeId, Context context) { - return getPurgeStatusWithResponseAsync(resourceGroupName, workspaceName, purgeId, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (purgeId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter purgeId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getPurgeStatusSync(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), + this.client.getSubscriptionId(), workspaceName, purgeId, accept, context); } /** @@ -392,4 +368,6 @@ public WorkspacePurgeStatusResponseInner getPurgeStatus(String resourceGroupName String purgeId) { return getPurgeStatusWithResponse(resourceGroupName, workspaceName, purgeId, Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspacePurgesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java index 271666c99ac4..81ff2fb97155 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesClientImpl.java @@ -14,6 +14,7 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; 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; @@ -28,12 +29,16 @@ 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.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.loganalytics.fluent.WorkspacesClient; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationListResult; import com.azure.resourcemanager.loganalytics.models.WorkspaceListResult; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; import java.nio.ByteBuffer; @@ -70,7 +75,7 @@ public final class WorkspacesClientImpl implements WorkspacesClient { * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "OperationalInsightsM") + @ServiceInterface(name = "OperationalInsightsManagementClientWorkspaces") public interface WorkspacesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces") @@ -80,6 +85,14 @@ Mono> list(@HostParam("$host") 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.OperationalInsights/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") 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}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces") @ExpectedResponses({ 200 }) @@ -88,6 +101,14 @@ Mono> listByResourceGroup(@HostParam("$host") Stri @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") @ExpectedResponses({ 200, 201, 202 }) @@ -98,6 +119,16 @@ Mono>> createOrUpdate(@HostParam("$host") String endpo @BodyParam("application/json") WorkspaceInner parameters, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createOrUpdateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") WorkspaceInner parameters, @HeaderParam("Accept") String accept, + Context context); + @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") @ExpectedResponses({ 200, 202, 204 }) @@ -107,6 +138,15 @@ Mono>> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @QueryParam("force") Boolean force, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") @ExpectedResponses({ 200 }) @@ -116,6 +156,15 @@ Mono> getByResourceGroup(@HostParam("$host") String end @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") @ExpectedResponses({ 200 }) @@ -125,6 +174,128 @@ Mono> update(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @BodyParam("application/json") WorkspacePatch parameters, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @BodyParam("application/json") WorkspacePatch parameters, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/locations/{location}/workspaces/{workspaceName}/failover") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failover(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/locations/{location}/workspaces/{workspaceName}/failover") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response failoverSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("location") String location, + @PathParam("workspaceName") String workspaceName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/failback") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> failback(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/failback") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response failbackSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNsp(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNspSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getNsp(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getNspSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reconcileNsp(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response reconcileNspSync(@HostParam("$host") String endpoint, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("workspaceName") String workspaceName, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNspNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNspNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -145,11 +316,10 @@ private Mono> listSinglePageAsync() { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), - accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -158,29 +328,13 @@ private Mono> listSinglePageAsync() { /** * Gets the workspaces in a 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 workspaces in a subscription along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the workspaces in a subscription as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync()); } /** @@ -188,11 +342,25 @@ private Mono> listSinglePageAsync(Context context) * * @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 workspaces in a subscription as paginated response with {@link PagedFlux}. + * @return the workspaces in a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -202,11 +370,25 @@ private PagedFlux listAsync() { * @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 workspaces in a subscription as paginated response with {@link PagedFlux}. + * @return the workspaces in a subscription along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -218,7 +400,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage()); } /** @@ -232,7 +414,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context)); } /** @@ -258,11 +440,10 @@ private Mono> listByResourceGroupSinglePageAsync(S return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - apiVersion, this.client.getSubscriptionId(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -272,35 +453,14 @@ private Mono> listByResourceGroupSinglePageAsync(S * Gets workspaces in a resource group. * * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return workspaces in a resource group along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return workspaces in a resource group as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName 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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); } /** @@ -310,11 +470,29 @@ private Mono> listByResourceGroupSinglePageAsync(S * @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 workspaces in a resource group as paginated response with {@link PagedFlux}. + * @return workspaces in a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -325,11 +503,29 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN * @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 workspaces in a resource group as paginated response with {@link PagedFlux}. + * @return workspaces in a resource group along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + resourceGroupName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + null, null); } /** @@ -343,7 +539,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroupN */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName)); } /** @@ -358,7 +554,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context)); } /** @@ -396,11 +592,10 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -410,41 +605,41 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. - * @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 top level Workspace resource container along with {@link Response} on successful completion of - * {@link Mono}. + * @return the top level Workspace resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String workspaceName, WorkspaceInner parameters, Context context) { + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + WorkspaceInner parameters) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), parameters, accept, context); + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, Context.NONE); } /** @@ -453,18 +648,42 @@ private Mono>> createOrUpdateWithResponseAsync(String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. + * @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 PollerFlux} for polling of the top level Workspace resource container. + * @return the top level Workspace resource container along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync(String resourceGroupName, - String workspaceName, WorkspaceInner parameters) { - Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WorkspaceInner.class, WorkspaceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createOrUpdateWithResponse(String resourceGroupName, String workspaceName, + WorkspaceInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String accept = "application/json"; + return service.createOrUpdateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -473,7 +692,6 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. - * @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. @@ -481,12 +699,11 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, WorkspaceInner> beginCreateOrUpdateAsync(String resourceGroupName, - String workspaceName, WorkspaceInner parameters, Context context) { - context = this.client.mergeContext(context); + String workspaceName, WorkspaceInner parameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, workspaceName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - WorkspaceInner.class, WorkspaceInner.class, context); + WorkspaceInner.class, WorkspaceInner.class, this.client.getContext()); } /** @@ -503,7 +720,9 @@ private PollerFlux, WorkspaceInner> beginCreateOrUpda @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkspaceInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters).getSyncPoller(); + Response response = createOrUpdateWithResponse(resourceGroupName, workspaceName, parameters); + return this.client.getLroResult(response, WorkspaceInner.class, + WorkspaceInner.class, Context.NONE); } /** @@ -521,7 +740,10 @@ public SyncPoller, WorkspaceInner> beginCreateOrUpdat @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, WorkspaceInner> beginCreateOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).getSyncPoller(); + Response response + = createOrUpdateWithResponse(resourceGroupName, workspaceName, parameters, context); + return this.client.getLroResult(response, WorkspaceInner.class, + WorkspaceInner.class, context); } /** @@ -548,17 +770,14 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. - * @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 top level Workspace resource container on successful completion of {@link Mono}. + * @return the top level Workspace resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String workspaceName, - WorkspaceInner parameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, parameters).getFinalResult(); } /** @@ -567,32 +786,55 @@ private Mono createOrUpdateAsync(String resourceGroupName, Strin * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. * @param parameters The parameters required to create or update a workspace. + * @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 top level Workspace resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters) { - return createOrUpdateAsync(resourceGroupName, workspaceName, parameters).block(); + public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters, + Context context) { + return beginCreateOrUpdate(resourceGroupName, workspaceName, parameters, context).getFinalResult(); } /** - * Create or update a workspace. + * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same + * subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. + * To remove the workspace completely and release the name, use the force flag. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param workspaceName The name of the workspace. - * @param parameters The parameters required to create or update a workspace. - * @param context The context to associate with this operation. + * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag + * cannot be recovered. * @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 top level Workspace resource container. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceName, WorkspaceInner parameters, - Context context) { - return createOrUpdateAsync(resourceGroupName, workspaceName, parameters, context).block(); + private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, + Boolean force) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), force, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -607,32 +849,31 @@ public WorkspaceInner createOrUpdate(String resourceGroupName, String workspaceN * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - Boolean force) { + private Response deleteWithResponse(String resourceGroupName, String workspaceName, Boolean force) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), force, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), force, accept, Context.NONE); } /** @@ -648,31 +889,32 @@ private Mono>> deleteWithResponseAsync(String resource * @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}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String workspaceName, - Boolean force, Context context) { + private Response deleteWithResponse(String resourceGroupName, String workspaceName, Boolean force, + Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), force, accept, context); + return service.deleteSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), force, accept, context); } /** @@ -726,20 +968,16 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup * @param workspaceName The name of the workspace. * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag * cannot be recovered. - * @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 PollerFlux} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String workspaceName, - Boolean force, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, workspaceName, force, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, + Boolean force) { + Response response = deleteWithResponse(resourceGroupName, workspaceName, force); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -757,7 +995,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName) { final Boolean force = null; - return this.beginDeleteAsync(resourceGroupName, workspaceName, force).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, force); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -778,7 +1017,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String workspaceName, Boolean force, Context context) { - return this.beginDeleteAsync(resourceGroupName, workspaceName, force, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, workspaceName, force, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -820,27 +1060,6 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName) { .flatMap(this.client::getLroFinalResultOrError); } - /** - * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same - * subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. - * To remove the workspace completely and release the name, use the force flag. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @param force Deletes the workspace without the recovery option. A workspace that was deleted with this flag - * cannot be recovered. - * @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 {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String workspaceName, Boolean force, Context context) { - return beginDeleteAsync(resourceGroupName, workspaceName, force, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Deletes a workspace resource. To recover the workspace, create it again with the same name, in the same * subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. @@ -855,7 +1074,7 @@ private Mono deleteAsync(String resourceGroupName, String workspaceName, B @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName) { final Boolean force = null; - deleteAsync(resourceGroupName, workspaceName, force).block(); + beginDelete(resourceGroupName, workspaceName, force).getFinalResult(); } /** @@ -874,7 +1093,7 @@ public void delete(String resourceGroupName, String workspaceName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String workspaceName, Boolean force, Context context) { - deleteAsync(resourceGroupName, workspaceName, force, context).block(); + beginDelete(resourceGroupName, workspaceName, force, context).getFinalResult(); } /** @@ -905,50 +1124,13 @@ private Mono> getByResourceGroupWithResponseAsync(Strin return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - workspaceName, apiVersion, this.client.getSubscriptionId(), accept, context)) + workspaceName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } - /** - * Gets a workspace instance. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param workspaceName The name of the workspace. - * @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 workspace instance along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String workspaceName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); - } - final String apiVersion = "2022-10-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), accept, context); - } - /** * Gets a workspace instance. * @@ -979,7 +1161,27 @@ private Mono getByResourceGroupAsync(String resourceGroupName, S @ServiceMethod(returns = ReturnType.SINGLE) public Response getByResourceGroupWithResponse(String resourceGroupName, String workspaceName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, workspaceName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); } /** @@ -1032,14 +1234,31 @@ private Mono> updateWithResponseAsync(String resourceGr } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, workspaceName, - apiVersion, this.client.getSubscriptionId(), parameters, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Updates a workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param parameters The parameters required to patch a workspace. + * @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 top level Workspace resource container on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String workspaceName, + WorkspacePatch parameters) { + return updateWithResponseAsync(resourceGroupName, workspaceName, parameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + /** * Updates a workspace. * @@ -1050,37 +1269,38 @@ private Mono> updateWithResponseAsync(String resourceGr * @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 top level Workspace resource container along with {@link Response} on successful completion of - * {@link Mono}. + * @return the top level Workspace resource container along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync(String resourceGroupName, String workspaceName, + public Response updateWithResponse(String resourceGroupName, String workspaceName, WorkspacePatch parameters, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (workspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName 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.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } - final String apiVersion = "2022-10-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, workspaceName, apiVersion, - this.client.getSubscriptionId(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); } /** @@ -1092,46 +1312,1118 @@ private Mono> updateWithResponseAsync(String resourceGr * @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 top level Workspace resource container on successful completion of {@link Mono}. + * @return the top level Workspace resource container. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String workspaceName, - WorkspacePatch parameters) { - return updateWithResponseAsync(resourceGroupName, workspaceName, parameters) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch parameters) { + return updateWithResponse(resourceGroupName, workspaceName, parameters, Context.NONE).getValue(); } /** - * Updates a workspace. + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. * @param workspaceName The name of the workspace. - * @param parameters The parameters required to patch a workspace. - * @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 top level Workspace resource container along with {@link Response}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse(String resourceGroupName, String workspaceName, - WorkspacePatch parameters, Context context) { - return updateWithResponseAsync(resourceGroupName, workspaceName, parameters, context).block(); + private Mono>> failoverWithResponseAsync(String resourceGroupName, String location, + String workspaceName) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failover(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, location, workspaceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates a workspace. + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. * @param workspaceName The name of the workspace. - * @param parameters The parameters required to patch a workspace. * @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 top level Workspace resource container. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public WorkspaceInner update(String resourceGroupName, String workspaceName, WorkspacePatch parameters) { - return updateWithResponse(resourceGroupName, workspaceName, parameters, Context.NONE).getValue(); + private Response failoverWithResponse(String resourceGroupName, String location, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.failoverSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + location, workspaceName, this.client.getApiVersion(), accept, Context.NONE); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failoverWithResponse(String resourceGroupName, String location, String workspaceName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.failoverSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + location, workspaceName, this.client.getApiVersion(), accept, context); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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> beginFailoverAsync(String resourceGroupName, String location, + String workspaceName) { + Mono>> mono = failoverWithResponseAsync(resourceGroupName, location, workspaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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> beginFailover(String resourceGroupName, String location, + String workspaceName) { + Response response = failoverWithResponse(resourceGroupName, location, workspaceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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> beginFailover(String resourceGroupName, String location, + String workspaceName, Context context) { + Response response = failoverWithResponse(resourceGroupName, location, workspaceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failoverAsync(String resourceGroupName, String location, String workspaceName) { + return beginFailoverAsync(resourceGroupName, location, workspaceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failover(String resourceGroupName, String location, String workspaceName) { + beginFailover(resourceGroupName, location, workspaceName).getFinalResult(); + } + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failover(String resourceGroupName, String location, String workspaceName, Context context) { + beginFailover(resourceGroupName, location, workspaceName, context).getFinalResult(); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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>> failbackWithResponseAsync(String resourceGroupName, String workspaceName) { + 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 (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.failback(this.client.getEndpoint(), this.client.getSubscriptionId(), + resourceGroupName, workspaceName, this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failbackWithResponse(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.failbackSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, Context.NONE); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failbackWithResponse(String resourceGroupName, String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.failbackSync(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, + workspaceName, this.client.getApiVersion(), accept, context); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> beginFailbackAsync(String resourceGroupName, String workspaceName) { + Mono>> mono = failbackWithResponseAsync(resourceGroupName, workspaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> beginFailback(String resourceGroupName, String workspaceName) { + Response response = failbackWithResponse(resourceGroupName, workspaceName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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> beginFailback(String resourceGroupName, String workspaceName, + Context context) { + Response response = failbackWithResponse(resourceGroupName, workspaceName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failbackAsync(String resourceGroupName, String workspaceName) { + return beginFailbackAsync(resourceGroupName, workspaceName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failback(String resourceGroupName, String workspaceName) { + beginFailback(resourceGroupName, workspaceName).getFinalResult(); + } + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failback(String resourceGroupName, String workspaceName, Context context) { + beginFailback(resourceGroupName, workspaceName, context).getFinalResult(); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNspSinglePageAsync(String resourceGroupName, String workspaceName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listNsp(this.client.getEndpoint(), resourceGroupName, workspaceName, + 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())); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listNspAsync(String resourceGroupName, + String workspaceName) { + return new PagedFlux<>(() -> listNspSinglePageAsync(resourceGroupName, workspaceName), + nextLink -> listNspNextSinglePageAsync(nextLink)); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNspSinglePage(String resourceGroupName, + String workspaceName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + 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); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNspSinglePage(String resourceGroupName, + String workspaceName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNsp(String resourceGroupName, + String workspaceName) { + return new PagedIterable<>(() -> listNspSinglePage(resourceGroupName, workspaceName), + nextLink -> listNspNextSinglePage(nextLink)); + } + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listNsp(String resourceGroupName, + String workspaceName, Context context) { + return new PagedIterable<>(() -> listNspSinglePage(resourceGroupName, workspaceName, context), + nextLink -> listNspNextSinglePage(nextLink, context)); + } + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getNspWithResponseAsync(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getNsp(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getNspAsync(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + return getNspWithResponseAsync(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getNspWithResponse(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, context); + } + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityPerimeterConfigurationInner getNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + return getNspWithResponse(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, + Context.NONE).getValue(); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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>> reconcileNspWithResponseAsync(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter workspaceName 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 (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.reconcileNsp(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 reconcileNspWithResponse(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.reconcileNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, Context.NONE); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 reconcileNspWithResponse(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (workspaceName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter workspaceName is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (networkSecurityPerimeterConfigurationName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.reconcileNspSync(this.client.getEndpoint(), resourceGroupName, workspaceName, + this.client.getApiVersion(), this.client.getSubscriptionId(), networkSecurityPerimeterConfigurationName, + accept, context); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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> beginReconcileNspAsync(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + Mono>> mono = reconcileNspWithResponseAsync(resourceGroupName, workspaceName, + networkSecurityPerimeterConfigurationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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> beginReconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + Response response + = reconcileNspWithResponse(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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> beginReconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context) { + Response response = reconcileNspWithResponse(resourceGroupName, workspaceName, + networkSecurityPerimeterConfigurationName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 reconcileNspAsync(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + return beginReconcileNspAsync(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 reconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + beginReconcileNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName).getFinalResult(); + } + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 reconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context) { + beginReconcileNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, 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 a list of NSP configurations for specified workspace along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listNspNextSinglePageAsync(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.listNspNext(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 a list of NSP configurations for specified workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNspNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNspNextSync(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 a list of NSP configurations for specified workspace along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNspNextSinglePage(String nextLink, + Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNspNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(WorkspacesClientImpl.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java index 4a7afc2cce12..7bc2e96fe454 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/implementation/WorkspacesImpl.java @@ -10,7 +10,9 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.loganalytics.fluent.WorkspacesClient; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfiguration; import com.azure.resourcemanager.loganalytics.models.Workspace; import com.azure.resourcemanager.loganalytics.models.Workspaces; @@ -76,6 +78,72 @@ public Workspace getByResourceGroup(String resourceGroupName, String workspaceNa } } + public void failover(String resourceGroupName, String location, String workspaceName) { + this.serviceClient().failover(resourceGroupName, location, workspaceName); + } + + public void failover(String resourceGroupName, String location, String workspaceName, Context context) { + this.serviceClient().failover(resourceGroupName, location, workspaceName, context); + } + + public void failback(String resourceGroupName, String workspaceName) { + this.serviceClient().failback(resourceGroupName, workspaceName); + } + + public void failback(String resourceGroupName, String workspaceName, Context context) { + this.serviceClient().failback(resourceGroupName, workspaceName, context); + } + + public PagedIterable listNsp(String resourceGroupName, + String workspaceName) { + PagedIterable inner + = this.serviceClient().listNsp(resourceGroupName, workspaceName); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); + } + + public PagedIterable listNsp(String resourceGroupName, String workspaceName, + Context context) { + PagedIterable inner + = this.serviceClient().listNsp(resourceGroupName, workspaceName, context); + return ResourceManagerUtils.mapPage(inner, + inner1 -> new NetworkSecurityPerimeterConfigurationImpl(inner1, this.manager())); + } + + public Response getNspWithResponse(String resourceGroupName, + String workspaceName, String networkSecurityPerimeterConfigurationName, Context context) { + Response inner = this.serviceClient() + .getNspWithResponse(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new NetworkSecurityPerimeterConfigurationImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public NetworkSecurityPerimeterConfiguration getNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + NetworkSecurityPerimeterConfigurationInner inner + = this.serviceClient().getNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName); + if (inner != null) { + return new NetworkSecurityPerimeterConfigurationImpl(inner, this.manager()); + } else { + return null; + } + } + + public void reconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName) { + this.serviceClient().reconcileNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName); + } + + public void reconcileNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context) { + this.serviceClient() + .reconcileNsp(resourceGroupName, workspaceName, networkSecurityPerimeterConfigurationName, context); + } + public Workspace getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourcegroups"); if (resourceGroupName == null) { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRule.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRule.java new file mode 100644 index 000000000000..0df999e62be1 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRule.java @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * Access rule in a network security perimeter configuration profile. + */ +@Fluent +public final class AccessRule implements JsonSerializable { + /* + * Name of the access rule + */ + private String name; + + /* + * Properties of Access Rule + */ + private AccessRuleProperties properties; + + /** + * Creates an instance of AccessRule class. + */ + public AccessRule() { + } + + /** + * Get the name property: Name of the access rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the access rule. + * + * @param name the name value to set. + * @return the AccessRule object itself. + */ + public AccessRule withName(String name) { + this.name = name; + return this; + } + + /** + * Get the properties property: Properties of Access Rule. + * + * @return the properties value. + */ + public AccessRuleProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of Access Rule. + * + * @param properties the properties value to set. + * @return the AccessRule object itself. + */ + public AccessRule withProperties(AccessRuleProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRule 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 AccessRule. + */ + public static AccessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRule deserializedAccessRule = new AccessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAccessRule.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAccessRule.properties = AccessRuleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRule; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleDirection.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleDirection.java new file mode 100644 index 000000000000..2989aa7e7b6c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleDirection.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Direction of Access Rule. + */ +public final class AccessRuleDirection extends ExpandableStringEnum { + /** + * Static value Inbound for AccessRuleDirection. + */ + public static final AccessRuleDirection INBOUND = fromString("Inbound"); + + /** + * Static value Outbound for AccessRuleDirection. + */ + public static final AccessRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates a new instance of AccessRuleDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessRuleDirection() { + } + + /** + * Creates or finds a AccessRuleDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessRuleDirection. + */ + public static AccessRuleDirection fromString(String name) { + return fromString(name, AccessRuleDirection.class); + } + + /** + * Gets known AccessRuleDirection values. + * + * @return known AccessRuleDirection values. + */ + public static Collection values() { + return values(AccessRuleDirection.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleProperties.java new file mode 100644 index 000000000000..3b7fcbcb3551 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRuleProperties.java @@ -0,0 +1,281 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * Properties of Access Rule. + */ +@Fluent +public final class AccessRuleProperties implements JsonSerializable { + /* + * Direction of Access Rule + */ + private AccessRuleDirection direction; + + /* + * Address prefixes in the CIDR format for inbound rules + */ + private List addressPrefixes; + + /* + * Subscriptions for inbound rules + */ + private List subscriptions; + + /* + * Network security perimeters for inbound rules + */ + private List networkSecurityPerimeters; + + /* + * Fully qualified domain names (FQDN) for outbound rules + */ + private List fullyQualifiedDomainNames; + + /* + * Email addresses for outbound rules + */ + private List emailAddresses; + + /* + * Phone numbers for outbound rules + */ + private List phoneNumbers; + + /** + * Creates an instance of AccessRuleProperties class. + */ + public AccessRuleProperties() { + } + + /** + * Get the direction property: Direction of Access Rule. + * + * @return the direction value. + */ + public AccessRuleDirection direction() { + return this.direction; + } + + /** + * Set the direction property: Direction of Access Rule. + * + * @param direction the direction value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withDirection(AccessRuleDirection direction) { + this.direction = direction; + return this; + } + + /** + * Get the addressPrefixes property: Address prefixes in the CIDR format for inbound rules. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Set the addressPrefixes property: Address prefixes in the CIDR format for inbound rules. + * + * @param addressPrefixes the addressPrefixes value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withAddressPrefixes(List addressPrefixes) { + this.addressPrefixes = addressPrefixes; + return this; + } + + /** + * Get the subscriptions property: Subscriptions for inbound rules. + * + * @return the subscriptions value. + */ + public List subscriptions() { + return this.subscriptions; + } + + /** + * Set the subscriptions property: Subscriptions for inbound rules. + * + * @param subscriptions the subscriptions value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withSubscriptions(List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** + * Get the networkSecurityPerimeters property: Network security perimeters for inbound rules. + * + * @return the networkSecurityPerimeters value. + */ + public List networkSecurityPerimeters() { + return this.networkSecurityPerimeters; + } + + /** + * Set the networkSecurityPerimeters property: Network security perimeters for inbound rules. + * + * @param networkSecurityPerimeters the networkSecurityPerimeters value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties + withNetworkSecurityPerimeters(List networkSecurityPerimeters) { + this.networkSecurityPerimeters = networkSecurityPerimeters; + return this; + } + + /** + * Get the fullyQualifiedDomainNames property: Fully qualified domain names (FQDN) for outbound rules. + * + * @return the fullyQualifiedDomainNames value. + */ + public List fullyQualifiedDomainNames() { + return this.fullyQualifiedDomainNames; + } + + /** + * Set the fullyQualifiedDomainNames property: Fully qualified domain names (FQDN) for outbound rules. + * + * @param fullyQualifiedDomainNames the fullyQualifiedDomainNames value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withFullyQualifiedDomainNames(List fullyQualifiedDomainNames) { + this.fullyQualifiedDomainNames = fullyQualifiedDomainNames; + return this; + } + + /** + * Get the emailAddresses property: Email addresses for outbound rules. + * + * @return the emailAddresses value. + */ + public List emailAddresses() { + return this.emailAddresses; + } + + /** + * Set the emailAddresses property: Email addresses for outbound rules. + * + * @param emailAddresses the emailAddresses value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withEmailAddresses(List emailAddresses) { + this.emailAddresses = emailAddresses; + return this; + } + + /** + * Get the phoneNumbers property: Phone numbers for outbound rules. + * + * @return the phoneNumbers value. + */ + public List phoneNumbers() { + return this.phoneNumbers; + } + + /** + * Set the phoneNumbers property: Phone numbers for outbound rules. + * + * @param phoneNumbers the phoneNumbers value to set. + * @return the AccessRuleProperties object itself. + */ + public AccessRuleProperties withPhoneNumbers(List phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptions() != null) { + subscriptions().forEach(e -> e.validate()); + } + if (networkSecurityPerimeters() != null) { + networkSecurityPerimeters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subscriptions", this.subscriptions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("networkSecurityPerimeters", this.networkSecurityPerimeters, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("fullyQualifiedDomainNames", this.fullyQualifiedDomainNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("emailAddresses", this.emailAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("phoneNumbers", this.phoneNumbers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRuleProperties 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 AccessRuleProperties. + */ + public static AccessRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRuleProperties deserializedAccessRuleProperties = new AccessRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("direction".equals(fieldName)) { + deserializedAccessRuleProperties.direction = AccessRuleDirection.fromString(reader.getString()); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.addressPrefixes = addressPrefixes; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions + = reader.readArray(reader1 -> AccessRulePropertiesSubscriptionsItem.fromJson(reader1)); + deserializedAccessRuleProperties.subscriptions = subscriptions; + } else if ("networkSecurityPerimeters".equals(fieldName)) { + List networkSecurityPerimeters + = reader.readArray(reader1 -> NetworkSecurityPerimeter.fromJson(reader1)); + deserializedAccessRuleProperties.networkSecurityPerimeters = networkSecurityPerimeters; + } else if ("fullyQualifiedDomainNames".equals(fieldName)) { + List fullyQualifiedDomainNames = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.fullyQualifiedDomainNames = fullyQualifiedDomainNames; + } else if ("emailAddresses".equals(fieldName)) { + List emailAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.emailAddresses = emailAddresses; + } else if ("phoneNumbers".equals(fieldName)) { + List phoneNumbers = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.phoneNumbers = phoneNumbers; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRuleProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRulePropertiesSubscriptionsItem.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRulePropertiesSubscriptionsItem.java new file mode 100644 index 000000000000..162f403f2da9 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AccessRulePropertiesSubscriptionsItem.java @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * Subscription identifiers. + */ +@Fluent +public final class AccessRulePropertiesSubscriptionsItem + implements JsonSerializable { + /* + * The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000') + */ + private String id; + + /** + * Creates an instance of AccessRulePropertiesSubscriptionsItem class. + */ + public AccessRulePropertiesSubscriptionsItem() { + } + + /** + * Get the id property: The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000'). + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000'). + * + * @param id the id value to set. + * @return the AccessRulePropertiesSubscriptionsItem object itself. + */ + public AccessRulePropertiesSubscriptionsItem withId(String id) { + this.id = id; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRulePropertiesSubscriptionsItem from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRulePropertiesSubscriptionsItem 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 AccessRulePropertiesSubscriptionsItem. + */ + public static AccessRulePropertiesSubscriptionsItem fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRulePropertiesSubscriptionsItem deserializedAccessRulePropertiesSubscriptionsItem + = new AccessRulePropertiesSubscriptionsItem(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAccessRulePropertiesSubscriptionsItem.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRulePropertiesSubscriptionsItem; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java index 5c61dfa853b2..7d47aa8f7013 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AssociatedWorkspace.java @@ -5,11 +5,14 @@ package com.azure.resourcemanager.loganalytics.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.util.UUID; /** * The list of Log Analytics workspaces associated with the cluster. @@ -19,7 +22,7 @@ public final class AssociatedWorkspace implements JsonSerializable UUID.fromString(nonNullReader.getString())); } else if ("workspaceName".equals(fieldName)) { deserializedAssociatedWorkspace.workspaceName = reader.getString(); } else if ("resourceId".equals(fieldName)) { deserializedAssociatedWorkspace.resourceId = reader.getString(); } else if ("associateDate".equals(fieldName)) { - deserializedAssociatedWorkspace.associateDate = reader.getString(); + deserializedAssociatedWorkspace.associateDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureResourceProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureResourceProperties.java deleted file mode 100644 index bc42393369e7..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/AzureResourceProperties.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.models; - -import com.azure.core.annotation.Immutable; -import com.azure.core.management.SystemData; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * An Azure resource QueryPack-Query object. - */ -@Immutable -public class AzureResourceProperties implements JsonSerializable { - /* - * Azure resource Id - */ - private String id; - - /* - * Azure resource name - */ - private String name; - - /* - * Azure resource type - */ - private String type; - - /* - * Read only system data - */ - private SystemData systemData; - - /** - * Creates an instance of AzureResourceProperties class. - */ - public AzureResourceProperties() { - } - - /** - * Get the id property: Azure resource Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: Azure resource Id. - * - * @param id the id value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: Azure resource name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: Azure resource name. - * - * @param name the name value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withName(String name) { - this.name = name; - return this; - } - - /** - * Get the type property: Azure resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Set the type property: Azure resource type. - * - * @param type the type value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withType(String type) { - this.type = type; - return this; - } - - /** - * Get the systemData property: Read only system data. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Set the systemData property: Read only system data. - * - * @param systemData the systemData value to set. - * @return the AzureResourceProperties object itself. - */ - AzureResourceProperties withSystemData(SystemData systemData) { - this.systemData = systemData; - return this; - } - - /** - * 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 AzureResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of AzureResourceProperties 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 AzureResourceProperties. - */ - public static AzureResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - AzureResourceProperties deserializedAzureResourceProperties = new AzureResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedAzureResourceProperties.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedAzureResourceProperties.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedAzureResourceProperties.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedAzureResourceProperties.systemData = SystemData.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedAzureResourceProperties; - }); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Capacity.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Capacity.java deleted file mode 100644 index e163765d4c0a..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Capacity.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.models; - -/** - * The capacity reservation level in Gigabytes for this cluster. - */ -public enum Capacity { - /** - * Enum value 100. - */ - ONE_ZERO_ZERO(100L), - - /** - * Enum value 200. - */ - TWO_ZERO_ZERO(200L), - - /** - * Enum value 300. - */ - THREE_ZERO_ZERO(300L), - - /** - * Enum value 400. - */ - FOUR_ZERO_ZERO(400L), - - /** - * Enum value 500. - */ - FIVE_ZERO_ZERO(500L), - - /** - * Enum value 1000. - */ - ONE_ZERO_ZERO_ZERO(1000L), - - /** - * Enum value 2000. - */ - TWO_ZERO_ZERO_ZERO(2000L), - - /** - * Enum value 5000. - */ - FIVE_ZERO_ZERO_ZERO(5000L), - - /** - * Enum value 10000. - */ - ONE_ZERO_ZERO_ZERO_ZERO(10000L), - - /** - * Enum value 25000. - */ - TWO_FIVE_ZERO_ZERO_ZERO(25000L), - - /** - * Enum value 50000. - */ - FIVE_ZERO_ZERO_ZERO_ZERO(50000L); - - /** - * The actual serialized value for a Capacity instance. - */ - private final long value; - - Capacity(long value) { - this.value = value; - } - - /** - * Parses a serialized value to a Capacity instance. - * - * @param value the serialized value to parse. - * @return the parsed Capacity object, or null if unable to parse. - */ - public static Capacity fromLong(long value) { - Capacity[] items = Capacity.values(); - for (Capacity item : items) { - if (item.toLong() == value) { - return item; - } - } - return null; - } - - /** - * De-serializes the instance to long value. - * - * @return the long value. - */ - public long toLong() { - return this.value; - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationLevel.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationLevel.java deleted file mode 100644 index ceb411fc31f0..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationLevel.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.models; - -/** - * The capacity reservation level in GB for this workspace, when CapacityReservation sku is selected. - */ -public enum CapacityReservationLevel { - /** - * Enum value 100. - */ - ONE_ZERO_ZERO(100), - - /** - * Enum value 200. - */ - TWO_ZERO_ZERO(200), - - /** - * Enum value 300. - */ - THREE_ZERO_ZERO(300), - - /** - * Enum value 400. - */ - FOUR_ZERO_ZERO(400), - - /** - * Enum value 500. - */ - FIVE_ZERO_ZERO(500), - - /** - * Enum value 1000. - */ - ONE_ZERO_ZERO_ZERO(1000), - - /** - * Enum value 2000. - */ - TWO_ZERO_ZERO_ZERO(2000), - - /** - * Enum value 5000. - */ - FIVE_ZERO_ZERO_ZERO(5000); - - /** - * The actual serialized value for a CapacityReservationLevel instance. - */ - private final int value; - - CapacityReservationLevel(int value) { - this.value = value; - } - - /** - * Parses a serialized value to a CapacityReservationLevel instance. - * - * @param value the serialized value to parse. - * @return the parsed CapacityReservationLevel object, or null if unable to parse. - */ - public static CapacityReservationLevel fromInt(int value) { - CapacityReservationLevel[] items = CapacityReservationLevel.values(); - for (CapacityReservationLevel item : items) { - if (item.toInt() == value) { - return item; - } - } - return null; - } - - /** - * De-serializes the instance to int value. - * - * @return the int value. - */ - public int toInt() { - return this.value; - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java index 6d8bff2edc0b..8d05f51f98c5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CapacityReservationProperties.java @@ -5,11 +5,13 @@ package com.azure.resourcemanager.loganalytics.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; /** * The Capacity Reservation properties. @@ -19,7 +21,7 @@ public final class CapacityReservationProperties implements JsonSerializable CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("minCapacity".equals(fieldName)) { deserializedCapacityReservationProperties.minCapacity = reader.getNullable(JsonReader::getLong); } else { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java index acc232dd92e1..d02109357d71 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Cluster.java @@ -7,6 +7,7 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.ClusterInner; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -113,14 +114,14 @@ public interface Cluster { * * @return the lastModifiedDate value. */ - String lastModifiedDate(); + OffsetDateTime lastModifiedDate(); /** * Gets the createdDate property: The cluster creation time. * * @return the createdDate value. */ - String createdDate(); + OffsetDateTime createdDate(); /** * Gets the associatedWorkspaces property: The list of Log Analytics workspaces associated with the cluster. @@ -136,6 +137,13 @@ public interface Cluster { */ CapacityReservationProperties capacityReservationProperties(); + /** + * Gets the replication property: Cluster's replication properties. + * + * @return the replication value. + */ + ClusterReplicationProperties replication(); + /** * Gets the region of the resource. * @@ -222,7 +230,8 @@ interface WithResourceGroup { interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithSku, DefinitionStages.WithIsDoubleEncryptionEnabled, DefinitionStages.WithIsAvailabilityZonesEnabled, DefinitionStages.WithBillingType, DefinitionStages.WithKeyVaultProperties, - DefinitionStages.WithAssociatedWorkspaces, DefinitionStages.WithCapacityReservationProperties { + DefinitionStages.WithAssociatedWorkspaces, DefinitionStages.WithCapacityReservationProperties, + DefinitionStages.WithReplication { /** * Executes the create request. * @@ -363,6 +372,19 @@ interface WithCapacityReservationProperties { */ WithCreate withCapacityReservationProperties(CapacityReservationProperties capacityReservationProperties); } + + /** + * The stage of the Cluster definition allowing to specify replication. + */ + interface WithReplication { + /** + * Specifies the replication property: Cluster's replication properties.. + * + * @param replication Cluster's replication properties. + * @return the next definition stage. + */ + WithCreate withReplication(ClusterReplicationProperties replication); + } } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationProperties.java new file mode 100644 index 000000000000..af1e66a31e6f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationProperties.java @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * Cluster replication properties. + */ +@Fluent +public final class ClusterReplicationProperties implements JsonSerializable { + /* + * The secondary location of the replication. If replication is being enabled, enabled must be provided. + */ + private String location; + + /* + * Specifies whether the replication is enabled or not. When true the cluster is replicate to the specified + * location. + */ + private Boolean enabled; + + /* + * Should enable AvailabilityZones for the given replicated cluster + */ + private Boolean isAvailabilityZonesEnabled; + + /* + * The provisioning state of the cluster replication. + */ + private ClusterReplicationState provisioningState; + + /* + * The cluster's replication creation time + */ + private OffsetDateTime createdDate; + + /* + * The last time the cluster's replication was updated. + */ + private OffsetDateTime lastModifiedDate; + + /** + * Creates an instance of ClusterReplicationProperties class. + */ + public ClusterReplicationProperties() { + } + + /** + * Get the location property: The secondary location of the replication. If replication is being enabled, enabled + * must be provided. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The secondary location of the replication. If replication is being enabled, enabled + * must be provided. + * + * @param location the location value to set. + * @return the ClusterReplicationProperties object itself. + */ + public ClusterReplicationProperties withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the enabled property: Specifies whether the replication is enabled or not. When true the cluster is replicate + * to the specified location. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether the replication is enabled or not. When true the cluster is replicate + * to the specified location. + * + * @param enabled the enabled value to set. + * @return the ClusterReplicationProperties object itself. + */ + public ClusterReplicationProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the isAvailabilityZonesEnabled property: Should enable AvailabilityZones for the given replicated cluster. + * + * @return the isAvailabilityZonesEnabled value. + */ + public Boolean isAvailabilityZonesEnabled() { + return this.isAvailabilityZonesEnabled; + } + + /** + * Set the isAvailabilityZonesEnabled property: Should enable AvailabilityZones for the given replicated cluster. + * + * @param isAvailabilityZonesEnabled the isAvailabilityZonesEnabled value to set. + * @return the ClusterReplicationProperties object itself. + */ + public ClusterReplicationProperties withIsAvailabilityZonesEnabled(Boolean isAvailabilityZonesEnabled) { + this.isAvailabilityZonesEnabled = isAvailabilityZonesEnabled; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the cluster replication. + * + * @return the provisioningState value. + */ + public ClusterReplicationState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdDate property: The cluster's replication creation time. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the lastModifiedDate property: The last time the cluster's replication was updated. + * + * @return the lastModifiedDate value. + */ + public OffsetDateTime lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * 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(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeBooleanField("isAvailabilityZonesEnabled", this.isAvailabilityZonesEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ClusterReplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ClusterReplicationProperties 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 ClusterReplicationProperties. + */ + public static ClusterReplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ClusterReplicationProperties deserializedClusterReplicationProperties = new ClusterReplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedClusterReplicationProperties.location = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedClusterReplicationProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("isAvailabilityZonesEnabled".equals(fieldName)) { + deserializedClusterReplicationProperties.isAvailabilityZonesEnabled + = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedClusterReplicationProperties.provisioningState + = ClusterReplicationState.fromString(reader.getString()); + } else if ("createdDate".equals(fieldName)) { + deserializedClusterReplicationProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDate".equals(fieldName)) { + deserializedClusterReplicationProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedClusterReplicationProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationState.java new file mode 100644 index 000000000000..0e275a7398cc --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterReplicationState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the cluster replication. + */ +public final class ClusterReplicationState extends ExpandableStringEnum { + /** + * Static value Succeeded for ClusterReplicationState. + */ + public static final ClusterReplicationState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value EnableRequested for ClusterReplicationState. + */ + public static final ClusterReplicationState ENABLE_REQUESTED = fromString("EnableRequested"); + + /** + * Static value Enabling for ClusterReplicationState. + */ + public static final ClusterReplicationState ENABLING = fromString("Enabling"); + + /** + * Static value DisableRequested for ClusterReplicationState. + */ + public static final ClusterReplicationState DISABLE_REQUESTED = fromString("DisableRequested"); + + /** + * Static value Disabling for ClusterReplicationState. + */ + public static final ClusterReplicationState DISABLING = fromString("Disabling"); + + /** + * Static value RollbackRequested for ClusterReplicationState. + */ + public static final ClusterReplicationState ROLLBACK_REQUESTED = fromString("RollbackRequested"); + + /** + * Static value RollingBack for ClusterReplicationState. + */ + public static final ClusterReplicationState ROLLING_BACK = fromString("RollingBack"); + + /** + * Static value Failed for ClusterReplicationState. + */ + public static final ClusterReplicationState FAILED = fromString("Failed"); + + /** + * Static value Canceled for ClusterReplicationState. + */ + public static final ClusterReplicationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of ClusterReplicationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterReplicationState() { + } + + /** + * Creates or finds a ClusterReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterReplicationState. + */ + public static ClusterReplicationState fromString(String name) { + return fromString(name, ClusterReplicationState.class); + } + + /** + * Gets known ClusterReplicationState values. + * + * @return known ClusterReplicationState values. + */ + public static Collection values() { + return values(ClusterReplicationState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java index e9a032eba3f6..960dc8903e61 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ClusterSku.java @@ -19,7 +19,7 @@ public final class ClusterSku implements JsonSerializable { /* * The capacity reservation level in Gigabytes for this cluster. */ - private Capacity capacity; + private Long capacity; /* * The SKU (tier) of a cluster. @@ -37,7 +37,7 @@ public ClusterSku() { * * @return the capacity value. */ - public Capacity capacity() { + public Long capacity() { return this.capacity; } @@ -47,7 +47,7 @@ public Capacity capacity() { * @param capacity the capacity value to set. * @return the ClusterSku object itself. */ - public ClusterSku withCapacity(Capacity capacity) { + public ClusterSku withCapacity(Long capacity) { this.capacity = capacity; return this; } @@ -86,7 +86,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeNumberField("capacity", this.capacity == null ? null : this.capacity.toLong()); + jsonWriter.writeNumberField("capacity", this.capacity); jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); return jsonWriter.writeEndObject(); } @@ -107,7 +107,7 @@ public static ClusterSku fromJson(JsonReader jsonReader) throws IOException { reader.nextToken(); if ("capacity".equals(fieldName)) { - deserializedClusterSku.capacity = Capacity.fromLong(reader.getLong()); + deserializedClusterSku.capacity = reader.getNullable(JsonReader::getLong); } else if ("name".equals(fieldName)) { deserializedClusterSku.name = ClusterSkuNameEnum.fromString(reader.getString()); } else { diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CreatedByType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CreatedByType.java deleted file mode 100644 index 3097d8e5c784..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/CreatedByType.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.models; - -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - -/** - * The type of identity that created the resource. - */ -public final class CreatedByType extends ExpandableStringEnum { - /** - * Static value User for CreatedByType. - */ - public static final CreatedByType USER = fromString("User"); - - /** - * Static value Application for CreatedByType. - */ - public static final CreatedByType APPLICATION = fromString("Application"); - - /** - * Static value ManagedIdentity for CreatedByType. - */ - public static final CreatedByType MANAGED_IDENTITY = fromString("ManagedIdentity"); - - /** - * Static value Key for CreatedByType. - */ - public static final CreatedByType KEY = fromString("Key"); - - /** - * Creates a new instance of CreatedByType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public CreatedByType() { - } - - /** - * Creates or finds a CreatedByType from its string representation. - * - * @param name a name to look for. - * @return the corresponding CreatedByType. - */ - public static CreatedByType fromString(String name) { - return fromString(name, CreatedByType.class); - } - - /** - * Gets known CreatedByType values. - * - * @return known CreatedByType values. - */ - public static Collection values() { - return values(CreatedByType.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java index c9267e6a3315..b1e162d20f3d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IdentityType.java @@ -4,73 +4,58 @@ package com.azure.resourcemanager.loganalytics.models; -import com.azure.core.util.ExpandableStringEnum; -import java.util.Collection; - /** - * The type of identity that creates/modifies resources. + * Type of managed service identity. */ -public final class IdentityType extends ExpandableStringEnum { - /** - * Static value user for IdentityType. - */ - public static final IdentityType USER = fromString("user"); - +public enum IdentityType { /** - * Static value application for IdentityType. + * Enum value SystemAssigned. */ - public static final IdentityType APPLICATION = fromString("application"); + SYSTEM_ASSIGNED("SystemAssigned"), /** - * Static value managedIdentity for IdentityType. + * Enum value UserAssigned. */ - public static final IdentityType MANAGED_IDENTITY = fromString("managedIdentity"); + USER_ASSIGNED("UserAssigned"), /** - * Static value key for IdentityType. + * Enum value None. */ - public static final IdentityType KEY = fromString("key"); + NONE("None"); /** - * Static value SystemAssigned for IdentityType. + * The actual serialized value for a IdentityType instance. */ - public static final IdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + private final String value; - /** - * Static value UserAssigned for IdentityType. - */ - public static final IdentityType USER_ASSIGNED = fromString("UserAssigned"); - - /** - * Static value None for IdentityType. - */ - public static final IdentityType NONE = fromString("None"); - - /** - * Creates a new instance of IdentityType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public IdentityType() { + IdentityType(String value) { + this.value = value; } /** - * Creates or finds a IdentityType from its string representation. + * Parses a serialized value to a IdentityType instance. * - * @param name a name to look for. - * @return the corresponding IdentityType. - */ - public static IdentityType fromString(String name) { - return fromString(name, IdentityType.class); + * @param value the serialized value to parse. + * @return the parsed IdentityType object, or null if unable to parse. + */ + public static IdentityType fromString(String value) { + if (value == null) { + return null; + } + IdentityType[] items = IdentityType.values(); + for (IdentityType item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; } /** - * Gets known IdentityType values. - * - * @return known IdentityType values. + * {@inheritDoc} */ - public static Collection values() { - return values(IdentityType.class); + @Override + public String toString() { + return this.value; } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IssueType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IssueType.java new file mode 100644 index 000000000000..581221777587 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/IssueType.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of issue. + */ +public final class IssueType extends ExpandableStringEnum { + /** + * Static value Unknown for IssueType. + */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** + * Static value ConfigurationPropagationFailure for IssueType. + */ + public static final IssueType CONFIGURATION_PROPAGATION_FAILURE = fromString("ConfigurationPropagationFailure"); + + /** + * Static value MissingPerimeterConfiguration for IssueType. + */ + public static final IssueType MISSING_PERIMETER_CONFIGURATION = fromString("MissingPerimeterConfiguration"); + + /** + * Static value MissingIdentityConfiguration for IssueType. + */ + public static final IssueType MISSING_IDENTITY_CONFIGURATION = fromString("MissingIdentityConfiguration"); + + /** + * Creates a new instance of IssueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IssueType() { + } + + /** + * Creates or finds a IssueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IssueType. + */ + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** + * Gets known IssueType values. + * + * @return known IssueType values. + */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java index 25d15670f112..03d115294b06 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPack.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; import java.time.OffsetDateTime; @@ -49,6 +50,13 @@ public interface LogAnalyticsQueryPack { */ Map tags(); + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the queryPackId property: The unique ID of your application. This field cannot be changed. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java index 58d3966e6302..c04f014bf2e5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/LogAnalyticsQueryPackQuery.java @@ -16,28 +16,28 @@ */ public interface LogAnalyticsQueryPackQuery { /** - * Gets the id property: Azure resource Id. + * Gets the id property: Fully qualified resource Id for the resource. * * @return the id value. */ String id(); /** - * Gets the name property: Azure resource name. + * Gets the name property: The name of the resource. * * @return the name value. */ String name(); /** - * Gets the type property: Azure resource type. + * Gets the type property: The type of the resource. * * @return the type value. */ String type(); /** - * Gets the systemData property: Read only system data. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeter.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeter.java new file mode 100644 index 000000000000..1d02c7faddf9 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeter.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.Objects; +import java.util.UUID; + +/** + * Information about a network security perimeter (NSP). + */ +@Fluent +public final class NetworkSecurityPerimeter implements JsonSerializable { + /* + * Fully qualified Azure resource ID of the NSP resource + */ + private String id; + + /* + * Universal unique ID (UUID) of the network security perimeter + */ + private UUID perimeterGuid; + + /* + * Location of the network security perimeter + */ + private String location; + + /** + * Creates an instance of NetworkSecurityPerimeter class. + */ + public NetworkSecurityPerimeter() { + } + + /** + * Get the id property: Fully qualified Azure resource ID of the NSP resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified Azure resource ID of the NSP resource. + * + * @param id the id value to set. + * @return the NetworkSecurityPerimeter object itself. + */ + public NetworkSecurityPerimeter withId(String id) { + this.id = id; + return this; + } + + /** + * Get the perimeterGuid property: Universal unique ID (UUID) of the network security perimeter. + * + * @return the perimeterGuid value. + */ + public UUID perimeterGuid() { + return this.perimeterGuid; + } + + /** + * Set the perimeterGuid property: Universal unique ID (UUID) of the network security perimeter. + * + * @param perimeterGuid the perimeterGuid value to set. + * @return the NetworkSecurityPerimeter object itself. + */ + public NetworkSecurityPerimeter withPerimeterGuid(UUID perimeterGuid) { + this.perimeterGuid = perimeterGuid; + return this; + } + + /** + * Get the location property: Location of the network security perimeter. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: Location of the network security perimeter. + * + * @param location the location value to set. + * @return the NetworkSecurityPerimeter object itself. + */ + public NetworkSecurityPerimeter withLocation(String location) { + this.location = location; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("perimeterGuid", Objects.toString(this.perimeterGuid, null)); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeter 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 NetworkSecurityPerimeter. + */ + public static NetworkSecurityPerimeter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeter deserializedNetworkSecurityPerimeter = new NetworkSecurityPerimeter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.id = reader.getString(); + } else if ("perimeterGuid".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.perimeterGuid + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("location".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeter; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfiguration.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfiguration.java new file mode 100644 index 000000000000..b3f25088937a --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfiguration.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; + +/** + * An immutable client-side representation of NetworkSecurityPerimeterConfiguration. + */ +public interface NetworkSecurityPerimeterConfiguration { + /** + * 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: Network security configuration properties. + * + * @return the properties value. + */ + NetworkSecurityPerimeterConfigurationProperties properties(); + + /** + * 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.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner + * object. + * + * @return the inner object. + */ + NetworkSecurityPerimeterConfigurationInner innerModel(); +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationListResult.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationListResult.java new file mode 100644 index 000000000000..613196535fd8 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationListResult.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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 com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * Result of a list NSP (network security perimeter) configurations request. + */ +@Fluent +public final class NetworkSecurityPerimeterConfigurationListResult + implements JsonSerializable { + /* + * Array of network security perimeter results. + */ + private List value; + + /* + * The link used to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationListResult class. + */ + public NetworkSecurityPerimeterConfigurationListResult() { + } + + /** + * Get the value property: Array of network security perimeter results. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Set the value property: Array of network security perimeter results. + * + * @param value the value value to set. + * @return the NetworkSecurityPerimeterConfigurationListResult object itself. + */ + public NetworkSecurityPerimeterConfigurationListResult + withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link used to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: The link used to get the next page of results. + * + * @param nextLink the nextLink value to set. + * @return the NetworkSecurityPerimeterConfigurationListResult object itself. + */ + public NetworkSecurityPerimeterConfigurationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@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 NetworkSecurityPerimeterConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationListResult 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 NetworkSecurityPerimeterConfigurationListResult. + */ + public static NetworkSecurityPerimeterConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationListResult deserializedNetworkSecurityPerimeterConfigurationListResult + = new NetworkSecurityPerimeterConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkSecurityPerimeterConfigurationInner.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationListResult; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProperties.java new file mode 100644 index 000000000000..65a18f9d8487 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProperties.java @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * Network security configuration properties. + */ +@Fluent +public final class NetworkSecurityPerimeterConfigurationProperties + implements JsonSerializable { + /* + * Provisioning state of a network security perimeter configuration that is being created or updated. + */ + private NetworkSecurityPerimeterConfigurationProvisioningState provisioningState; + + /* + * List of provisioning issues, if any + */ + private List provisioningIssues; + + /* + * Information about a network security perimeter (NSP) + */ + private NetworkSecurityPerimeter networkSecurityPerimeter; + + /* + * Information about resource association + */ + private ResourceAssociation resourceAssociation; + + /* + * Network security perimeter configuration profile + */ + private NetworkSecurityProfile profile; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationProperties class. + */ + public NetworkSecurityPerimeterConfigurationProperties() { + } + + /** + * Get the provisioningState property: Provisioning state of a network security perimeter configuration that is + * being created or updated. + * + * @return the provisioningState value. + */ + public NetworkSecurityPerimeterConfigurationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisioningIssues property: List of provisioning issues, if any. + * + * @return the provisioningIssues value. + */ + public List provisioningIssues() { + return this.provisioningIssues; + } + + /** + * Get the networkSecurityPerimeter property: Information about a network security perimeter (NSP). + * + * @return the networkSecurityPerimeter value. + */ + public NetworkSecurityPerimeter networkSecurityPerimeter() { + return this.networkSecurityPerimeter; + } + + /** + * Set the networkSecurityPerimeter property: Information about a network security perimeter (NSP). + * + * @param networkSecurityPerimeter the networkSecurityPerimeter value to set. + * @return the NetworkSecurityPerimeterConfigurationProperties object itself. + */ + public NetworkSecurityPerimeterConfigurationProperties + withNetworkSecurityPerimeter(NetworkSecurityPerimeter networkSecurityPerimeter) { + this.networkSecurityPerimeter = networkSecurityPerimeter; + return this; + } + + /** + * Get the resourceAssociation property: Information about resource association. + * + * @return the resourceAssociation value. + */ + public ResourceAssociation resourceAssociation() { + return this.resourceAssociation; + } + + /** + * Set the resourceAssociation property: Information about resource association. + * + * @param resourceAssociation the resourceAssociation value to set. + * @return the NetworkSecurityPerimeterConfigurationProperties object itself. + */ + public NetworkSecurityPerimeterConfigurationProperties + withResourceAssociation(ResourceAssociation resourceAssociation) { + this.resourceAssociation = resourceAssociation; + return this; + } + + /** + * Get the profile property: Network security perimeter configuration profile. + * + * @return the profile value. + */ + public NetworkSecurityProfile profile() { + return this.profile; + } + + /** + * Set the profile property: Network security perimeter configuration profile. + * + * @param profile the profile value to set. + * @return the NetworkSecurityPerimeterConfigurationProperties object itself. + */ + public NetworkSecurityPerimeterConfigurationProperties withProfile(NetworkSecurityProfile profile) { + this.profile = profile; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningIssues() != null) { + provisioningIssues().forEach(e -> e.validate()); + } + if (networkSecurityPerimeter() != null) { + networkSecurityPerimeter().validate(); + } + if (resourceAssociation() != null) { + resourceAssociation().validate(); + } + if (profile() != null) { + profile().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkSecurityPerimeter", this.networkSecurityPerimeter); + jsonWriter.writeJsonField("resourceAssociation", this.resourceAssociation); + jsonWriter.writeJsonField("profile", this.profile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationProperties 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 NetworkSecurityPerimeterConfigurationProperties. + */ + public static NetworkSecurityPerimeterConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationProperties deserializedNetworkSecurityPerimeterConfigurationProperties + = new NetworkSecurityPerimeterConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningState + = NetworkSecurityPerimeterConfigurationProvisioningState.fromString(reader.getString()); + } else if ("provisioningIssues".equals(fieldName)) { + List provisioningIssues + = reader.readArray(reader1 -> ProvisioningIssue.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningIssues = provisioningIssues; + } else if ("networkSecurityPerimeter".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.networkSecurityPerimeter + = NetworkSecurityPerimeter.fromJson(reader); + } else if ("resourceAssociation".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.resourceAssociation + = ResourceAssociation.fromJson(reader); + } else if ("profile".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.profile + = NetworkSecurityProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProvisioningState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProvisioningState.java new file mode 100644 index 000000000000..14d7c837af16 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityPerimeterConfigurationProvisioningState.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of a network security perimeter configuration that is being created or updated. + */ +public final class NetworkSecurityPerimeterConfigurationProvisioningState + extends ExpandableStringEnum { + /** + * Static value Succeeded for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Creating for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Accepted for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value Failed for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of NetworkSecurityPerimeterConfigurationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkSecurityPerimeterConfigurationProvisioningState() { + } + + /** + * Creates or finds a NetworkSecurityPerimeterConfigurationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static NetworkSecurityPerimeterConfigurationProvisioningState fromString(String name) { + return fromString(name, NetworkSecurityPerimeterConfigurationProvisioningState.class); + } + + /** + * Gets known NetworkSecurityPerimeterConfigurationProvisioningState values. + * + * @return known NetworkSecurityPerimeterConfigurationProvisioningState values. + */ + public static Collection values() { + return values(NetworkSecurityPerimeterConfigurationProvisioningState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityProfile.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityProfile.java new file mode 100644 index 000000000000..1eb214465188 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/NetworkSecurityProfile.java @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * Network security perimeter configuration profile. + */ +@Fluent +public final class NetworkSecurityProfile implements JsonSerializable { + /* + * Name of the profile + */ + private String name; + + /* + * Current access rules version + */ + private Integer accessRulesVersion; + + /* + * List of Access Rules + */ + private List accessRules; + + /* + * Current diagnostic settings version + */ + private Integer diagnosticSettingsVersion; + + /* + * List of log categories that are enabled + */ + private List enabledLogCategories; + + /** + * Creates an instance of NetworkSecurityProfile class. + */ + public NetworkSecurityProfile() { + } + + /** + * Get the name property: Name of the profile. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the profile. + * + * @param name the name value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withName(String name) { + this.name = name; + return this; + } + + /** + * Get the accessRulesVersion property: Current access rules version. + * + * @return the accessRulesVersion value. + */ + public Integer accessRulesVersion() { + return this.accessRulesVersion; + } + + /** + * Set the accessRulesVersion property: Current access rules version. + * + * @param accessRulesVersion the accessRulesVersion value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withAccessRulesVersion(Integer accessRulesVersion) { + this.accessRulesVersion = accessRulesVersion; + return this; + } + + /** + * Get the accessRules property: List of Access Rules. + * + * @return the accessRules value. + */ + public List accessRules() { + return this.accessRules; + } + + /** + * Set the accessRules property: List of Access Rules. + * + * @param accessRules the accessRules value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withAccessRules(List accessRules) { + this.accessRules = accessRules; + return this; + } + + /** + * Get the diagnosticSettingsVersion property: Current diagnostic settings version. + * + * @return the diagnosticSettingsVersion value. + */ + public Integer diagnosticSettingsVersion() { + return this.diagnosticSettingsVersion; + } + + /** + * Set the diagnosticSettingsVersion property: Current diagnostic settings version. + * + * @param diagnosticSettingsVersion the diagnosticSettingsVersion value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withDiagnosticSettingsVersion(Integer diagnosticSettingsVersion) { + this.diagnosticSettingsVersion = diagnosticSettingsVersion; + return this; + } + + /** + * Get the enabledLogCategories property: List of log categories that are enabled. + * + * @return the enabledLogCategories value. + */ + public List enabledLogCategories() { + return this.enabledLogCategories; + } + + /** + * Set the enabledLogCategories property: List of log categories that are enabled. + * + * @param enabledLogCategories the enabledLogCategories value to set. + * @return the NetworkSecurityProfile object itself. + */ + public NetworkSecurityProfile withEnabledLogCategories(List enabledLogCategories) { + this.enabledLogCategories = enabledLogCategories; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessRules() != null) { + accessRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("accessRulesVersion", this.accessRulesVersion); + jsonWriter.writeArrayField("accessRules", this.accessRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("diagnosticSettingsVersion", this.diagnosticSettingsVersion); + jsonWriter.writeArrayField("enabledLogCategories", this.enabledLogCategories, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityProfile 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 NetworkSecurityProfile. + */ + public static NetworkSecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityProfile deserializedNetworkSecurityProfile = new NetworkSecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityProfile.name = reader.getString(); + } else if ("accessRulesVersion".equals(fieldName)) { + deserializedNetworkSecurityProfile.accessRulesVersion = reader.getNullable(JsonReader::getInt); + } else if ("accessRules".equals(fieldName)) { + List accessRules = reader.readArray(reader1 -> AccessRule.fromJson(reader1)); + deserializedNetworkSecurityProfile.accessRules = accessRules; + } else if ("diagnosticSettingsVersion".equals(fieldName)) { + deserializedNetworkSecurityProfile.diagnosticSettingsVersion + = reader.getNullable(JsonReader::getInt); + } else if ("enabledLogCategories".equals(fieldName)) { + List enabledLogCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkSecurityProfile.enabledLogCategories = enabledLogCategories; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityProfile; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssue.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssue.java new file mode 100644 index 000000000000..879dac647c66 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssue.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * Describes a provisioning issue for a network security perimeter configuration. + */ +@Immutable +public final class ProvisioningIssue implements JsonSerializable { + /* + * Name of the issue + */ + private String name; + + /* + * Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should + * generate separate provisioning issue elements for each separate issue detected, and include a meaningful and + * distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules + */ + private ProvisioningIssueProperties properties; + + /** + * Creates an instance of ProvisioningIssue class. + */ + public ProvisioningIssue() { + } + + /** + * Get the name property: Name of the issue. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the properties property: Details of a provisioning issue for a network security perimeter (NSP) + * configuration. Resource providers should generate separate provisioning issue elements for each separate issue + * detected, and include a meaningful and distinctive description, as well as any appropriate suggestedResourceIds + * and suggestedAccessRules. + * + * @return the properties value. + */ + public ProvisioningIssueProperties properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssue 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 ProvisioningIssue. + */ + public static ProvisioningIssue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssue deserializedProvisioningIssue = new ProvisioningIssue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedProvisioningIssue.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProvisioningIssue.properties = ProvisioningIssueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssue; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssueProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssueProperties.java new file mode 100644 index 000000000000..03b7d5581a79 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ProvisioningIssueProperties.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; +import java.util.List; + +/** + * Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should + * generate separate provisioning issue elements for each separate issue detected, and include a meaningful and + * distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. + */ +@Immutable +public final class ProvisioningIssueProperties implements JsonSerializable { + /* + * Type of issue + */ + private IssueType issueType; + + /* + * Severity of the issue. + */ + private Severity severity; + + /* + * Description of the issue + */ + private String description; + + /* + * Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter + * (NSP) to remediate the issue. + */ + private List suggestedResourceIds; + + /* + * Access rules that can be added to the network security profile (NSP) to remediate the issue. + */ + private List suggestedAccessRules; + + /** + * Creates an instance of ProvisioningIssueProperties class. + */ + public ProvisioningIssueProperties() { + } + + /** + * Get the issueType property: Type of issue. + * + * @return the issueType value. + */ + public IssueType issueType() { + return this.issueType; + } + + /** + * Get the severity property: Severity of the issue. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the description property: Description of the issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the suggestedResourceIds property: Fully qualified resource IDs of suggested resources that can be associated + * to the network security perimeter (NSP) to remediate the issue. + * + * @return the suggestedResourceIds value. + */ + public List suggestedResourceIds() { + return this.suggestedResourceIds; + } + + /** + * Get the suggestedAccessRules property: Access rules that can be added to the network security profile (NSP) to + * remediate the issue. + * + * @return the suggestedAccessRules value. + */ + public List suggestedAccessRules() { + return this.suggestedAccessRules; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (suggestedAccessRules() != null) { + suggestedAccessRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssueProperties 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 ProvisioningIssueProperties. + */ + public static ProvisioningIssueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssueProperties deserializedProvisioningIssueProperties = new ProvisioningIssueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issueType".equals(fieldName)) { + deserializedProvisioningIssueProperties.issueType = IssueType.fromString(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedProvisioningIssueProperties.severity = Severity.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedProvisioningIssueProperties.description = reader.getString(); + } else if ("suggestedResourceIds".equals(fieldName)) { + List suggestedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedProvisioningIssueProperties.suggestedResourceIds = suggestedResourceIds; + } else if ("suggestedAccessRules".equals(fieldName)) { + List suggestedAccessRules = reader.readArray(reader1 -> AccessRule.fromJson(reader1)); + deserializedProvisioningIssueProperties.suggestedAccessRules = suggestedAccessRules; + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssueProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/PublicNetworkAccessType.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/PublicNetworkAccessType.java index 443126c11d10..96b101885afc 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/PublicNetworkAccessType.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/PublicNetworkAccessType.java @@ -21,6 +21,11 @@ public final class PublicNetworkAccessType extends ExpandableStringEnum tags) { - super.withTags(tags); - return this; - } - - /** - * 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(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of QueryPacksResource from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of QueryPacksResource 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 QueryPacksResource. - */ - public static QueryPacksResource fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - QueryPacksResource deserializedQueryPacksResource = new QueryPacksResource(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedQueryPacksResource.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedQueryPacksResource.name = reader.getString(); - } else if ("type".equals(fieldName)) { - deserializedQueryPacksResource.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedQueryPacksResource.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedQueryPacksResource.withTags(tags); - } else { - reader.skipChildren(); - } - } - - return deserializedQueryPacksResource; - }); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociation.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociation.java new file mode 100644 index 000000000000..27f7152f88ae --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociation.java @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * Information about resource association. + */ +@Fluent +public final class ResourceAssociation implements JsonSerializable { + /* + * Name of the resource association + */ + private String name; + + /* + * Access mode of the resource association + */ + private ResourceAssociationAccessMode accessMode; + + /** + * Creates an instance of ResourceAssociation class. + */ + public ResourceAssociation() { + } + + /** + * Get the name property: Name of the resource association. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the resource association. + * + * @param name the name value to set. + * @return the ResourceAssociation object itself. + */ + public ResourceAssociation withName(String name) { + this.name = name; + return this; + } + + /** + * Get the accessMode property: Access mode of the resource association. + * + * @return the accessMode value. + */ + public ResourceAssociationAccessMode accessMode() { + return this.accessMode; + } + + /** + * Set the accessMode property: Access mode of the resource association. + * + * @param accessMode the accessMode value to set. + * @return the ResourceAssociation object itself. + */ + public ResourceAssociation withAccessMode(ResourceAssociationAccessMode accessMode) { + this.accessMode = accessMode; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceAssociation 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 ResourceAssociation. + */ + public static ResourceAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceAssociation deserializedResourceAssociation = new ResourceAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResourceAssociation.name = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedResourceAssociation.accessMode + = ResourceAssociationAccessMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceAssociation; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociationAccessMode.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociationAccessMode.java new file mode 100644 index 000000000000..503c299a0176 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/ResourceAssociationAccessMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Access mode of the resource association. + */ +public final class ResourceAssociationAccessMode extends ExpandableStringEnum { + /** + * Static value Enforced for ResourceAssociationAccessMode. + */ + public static final ResourceAssociationAccessMode ENFORCED = fromString("Enforced"); + + /** + * Static value Learning for ResourceAssociationAccessMode. + */ + public static final ResourceAssociationAccessMode LEARNING = fromString("Learning"); + + /** + * Static value Audit for ResourceAssociationAccessMode. + */ + public static final ResourceAssociationAccessMode AUDIT = fromString("Audit"); + + /** + * Creates a new instance of ResourceAssociationAccessMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceAssociationAccessMode() { + } + + /** + * Creates or finds a ResourceAssociationAccessMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceAssociationAccessMode. + */ + public static ResourceAssociationAccessMode fromString(String name) { + return fromString(name, ResourceAssociationAccessMode.class); + } + + /** + * Gets known ResourceAssociationAccessMode values. + * + * @return known ResourceAssociationAccessMode values. + */ + public static Collection values() { + return values(ResourceAssociationAccessMode.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleDefinition.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleDefinition.java new file mode 100644 index 000000000000..e75c4689d31c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleDefinition.java @@ -0,0 +1,238 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.time.format.DateTimeFormatter; + +/** + * Rule definition parameters. + */ +@Fluent +public final class RuleDefinition implements JsonSerializable { + /* + * Summary rule query. + */ + private String query; + + /* + * Scheduled window in minutes. Allowed values: 20, 30, 60, 120, 180, 360, 720, 1440. + */ + private Integer binSize; + + /* + * The minimum delay in seconds before bin processing. + */ + private Integer binDelay; + + /* + * The start time (UTC) when Summary rule execution starts. + */ + private OffsetDateTime binStartTime; + + /* + * The time cursor used in Summary rules bins processing, e.g. TimeGenerated. + */ + private TimeSelectorEnum timeSelector; + + /* + * The destination table used for the Summary rule results. + */ + private String destinationTable; + + /** + * Creates an instance of RuleDefinition class. + */ + public RuleDefinition() { + } + + /** + * Get the query property: Summary rule query. + * + * @return the query value. + */ + public String query() { + return this.query; + } + + /** + * Set the query property: Summary rule query. + * + * @param query the query value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withQuery(String query) { + this.query = query; + return this; + } + + /** + * Get the binSize property: Scheduled window in minutes. Allowed values: 20, 30, 60, 120, 180, 360, 720, 1440. + * + * @return the binSize value. + */ + public Integer binSize() { + return this.binSize; + } + + /** + * Set the binSize property: Scheduled window in minutes. Allowed values: 20, 30, 60, 120, 180, 360, 720, 1440. + * + * @param binSize the binSize value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withBinSize(Integer binSize) { + this.binSize = binSize; + return this; + } + + /** + * Get the binDelay property: The minimum delay in seconds before bin processing. + * + * @return the binDelay value. + */ + public Integer binDelay() { + return this.binDelay; + } + + /** + * Set the binDelay property: The minimum delay in seconds before bin processing. + * + * @param binDelay the binDelay value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withBinDelay(Integer binDelay) { + this.binDelay = binDelay; + return this; + } + + /** + * Get the binStartTime property: The start time (UTC) when Summary rule execution starts. + * + * @return the binStartTime value. + */ + public OffsetDateTime binStartTime() { + return this.binStartTime; + } + + /** + * Set the binStartTime property: The start time (UTC) when Summary rule execution starts. + * + * @param binStartTime the binStartTime value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withBinStartTime(OffsetDateTime binStartTime) { + this.binStartTime = binStartTime; + return this; + } + + /** + * Get the timeSelector property: The time cursor used in Summary rules bins processing, e.g. TimeGenerated. + * + * @return the timeSelector value. + */ + public TimeSelectorEnum timeSelector() { + return this.timeSelector; + } + + /** + * Set the timeSelector property: The time cursor used in Summary rules bins processing, e.g. TimeGenerated. + * + * @param timeSelector the timeSelector value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withTimeSelector(TimeSelectorEnum timeSelector) { + this.timeSelector = timeSelector; + return this; + } + + /** + * Get the destinationTable property: The destination table used for the Summary rule results. + * + * @return the destinationTable value. + */ + public String destinationTable() { + return this.destinationTable; + } + + /** + * Set the destinationTable property: The destination table used for the Summary rule results. + * + * @param destinationTable the destinationTable value to set. + * @return the RuleDefinition object itself. + */ + public RuleDefinition withDestinationTable(String destinationTable) { + this.destinationTable = destinationTable; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("query", this.query); + jsonWriter.writeNumberField("binSize", this.binSize); + jsonWriter.writeNumberField("binDelay", this.binDelay); + jsonWriter.writeStringField("binStartTime", + this.binStartTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.binStartTime)); + jsonWriter.writeStringField("timeSelector", this.timeSelector == null ? null : this.timeSelector.toString()); + jsonWriter.writeStringField("destinationTable", this.destinationTable); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RuleDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RuleDefinition 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 RuleDefinition. + */ + public static RuleDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RuleDefinition deserializedRuleDefinition = new RuleDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("query".equals(fieldName)) { + deserializedRuleDefinition.query = reader.getString(); + } else if ("binSize".equals(fieldName)) { + deserializedRuleDefinition.binSize = reader.getNullable(JsonReader::getInt); + } else if ("binDelay".equals(fieldName)) { + deserializedRuleDefinition.binDelay = reader.getNullable(JsonReader::getInt); + } else if ("binStartTime".equals(fieldName)) { + deserializedRuleDefinition.binStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("timeSelector".equals(fieldName)) { + deserializedRuleDefinition.timeSelector = TimeSelectorEnum.fromString(reader.getString()); + } else if ("destinationTable".equals(fieldName)) { + deserializedRuleDefinition.destinationTable = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedRuleDefinition; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleTypeEnum.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleTypeEnum.java new file mode 100644 index 000000000000..2e757c9ed2d6 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/RuleTypeEnum.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * SummaryRules rule type: User. + */ +public final class RuleTypeEnum extends ExpandableStringEnum { + /** + * Static value User for RuleTypeEnum. + */ + public static final RuleTypeEnum USER = fromString("User"); + + /** + * Creates a new instance of RuleTypeEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public RuleTypeEnum() { + } + + /** + * Creates or finds a RuleTypeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding RuleTypeEnum. + */ + public static RuleTypeEnum fromString(String name) { + return fromString(name, RuleTypeEnum.class); + } + + /** + * Gets known RuleTypeEnum values. + * + * @return known RuleTypeEnum values. + */ + public static Collection values() { + return values(RuleTypeEnum.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Severity.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Severity.java new file mode 100644 index 000000000000..b9ce652f7e05 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Severity.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Severity of the issue. + */ +public final class Severity extends ExpandableStringEnum { + /** + * Static value Warning for Severity. + */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Static value Error for Severity. + */ + public static final Severity ERROR = fromString("Error"); + + /** + * Creates a new instance of Severity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Severity() { + } + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @return known Severity values. + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/StatusCodeEnum.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/StatusCodeEnum.java new file mode 100644 index 000000000000..9aaf9f5b5e43 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/StatusCodeEnum.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates the reason for rule deactivation. + */ +public final class StatusCodeEnum extends ExpandableStringEnum { + /** + * Static value UserAction for StatusCodeEnum. + */ + public static final StatusCodeEnum USER_ACTION = fromString("UserAction"); + + /** + * Static value DataPlaneError for StatusCodeEnum. + */ + public static final StatusCodeEnum DATA_PLANE_ERROR = fromString("DataPlaneError"); + + /** + * Creates a new instance of StatusCodeEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public StatusCodeEnum() { + } + + /** + * Creates or finds a StatusCodeEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding StatusCodeEnum. + */ + public static StatusCodeEnum fromString(String name) { + return fromString(name, StatusCodeEnum.class); + } + + /** + * Gets known StatusCodeEnum values. + * + * @return known StatusCodeEnum values. + */ + public static Collection values() { + return values(StatusCodeEnum.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogs.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogs.java new file mode 100644 index 000000000000..ea4a2602b17f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogs.java @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; +import com.azure.core.util.Context; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; + +/** + * An immutable client-side representation of SummaryLogs. + */ +public interface SummaryLogs { + /** + * 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 systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the ruleType property: SummaryRules rule type: User. + * + * @return the ruleType value. + */ + RuleTypeEnum ruleType(); + + /** + * Gets the displayName property: The display name of the Summary rule. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the description property: The description of the Summary rule. + * + * @return the description value. + */ + String description(); + + /** + * Gets the isActive property: Indicates if Summary rule is active. If not, Summary rule execution stops. + * + * @return the isActive value. + */ + Boolean isActive(); + + /** + * Gets the statusCode property: Indicates the reason for rule deactivation. + * + * @return the statusCode value. + */ + StatusCodeEnum statusCode(); + + /** + * Gets the provisioningState property: Summary rule is in provisioning state. If set to 'updating' or 'deleting', + * indicates a resource lock due to an ongoing operation, preventing any update to the Summary rule until the + * operation is complete. + * + * @return the provisioningState value. + */ + ProvisioningStateEnum provisioningState(); + + /** + * Gets the ruleDefinition property: Rule definition parameters. + * + * @return the ruleDefinition value. + */ + RuleDefinition ruleDefinition(); + + /** + * Gets the name of the resource group. + * + * @return the name of the resource group. + */ + String resourceGroupName(); + + /** + * Gets the inner com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner object. + * + * @return the inner object. + */ + SummaryLogsInner innerModel(); + + /** + * The entirety of the SummaryLogs definition. + */ + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithParentResource, DefinitionStages.WithCreate { + } + + /** + * The SummaryLogs definition stages. + */ + interface DefinitionStages { + /** + * The first stage of the SummaryLogs definition. + */ + interface Blank extends WithParentResource { + } + + /** + * The stage of the SummaryLogs definition allowing to specify parent resource. + */ + interface WithParentResource { + /** + * Specifies resourceGroupName, workspaceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @return the next definition stage. + */ + WithCreate withExistingWorkspace(String resourceGroupName, String workspaceName); + } + + /** + * The stage of the SummaryLogs 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.WithRuleType, DefinitionStages.WithDisplayName, + DefinitionStages.WithDescription, DefinitionStages.WithRuleDefinition { + /** + * Executes the create request. + * + * @return the created resource. + */ + SummaryLogs create(); + + /** + * Executes the create request. + * + * @param context The context to associate with this operation. + * @return the created resource. + */ + SummaryLogs create(Context context); + } + + /** + * The stage of the SummaryLogs definition allowing to specify ruleType. + */ + interface WithRuleType { + /** + * Specifies the ruleType property: SummaryRules rule type: User.. + * + * @param ruleType SummaryRules rule type: User. + * @return the next definition stage. + */ + WithCreate withRuleType(RuleTypeEnum ruleType); + } + + /** + * The stage of the SummaryLogs definition allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the Summary rule.. + * + * @param displayName The display name of the Summary rule. + * @return the next definition stage. + */ + WithCreate withDisplayName(String displayName); + } + + /** + * The stage of the SummaryLogs definition allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the Summary rule.. + * + * @param description The description of the Summary rule. + * @return the next definition stage. + */ + WithCreate withDescription(String description); + } + + /** + * The stage of the SummaryLogs definition allowing to specify ruleDefinition. + */ + interface WithRuleDefinition { + /** + * Specifies the ruleDefinition property: Rule definition parameters.. + * + * @param ruleDefinition Rule definition parameters. + * @return the next definition stage. + */ + WithCreate withRuleDefinition(RuleDefinition ruleDefinition); + } + } + + /** + * Begins update for the SummaryLogs resource. + * + * @return the stage of resource update. + */ + SummaryLogs.Update update(); + + /** + * The template for SummaryLogs update. + */ + interface Update extends UpdateStages.WithRuleType, UpdateStages.WithDisplayName, UpdateStages.WithDescription, + UpdateStages.WithRuleDefinition { + /** + * Executes the update request. + * + * @return the updated resource. + */ + SummaryLogs apply(); + + /** + * Executes the update request. + * + * @param context The context to associate with this operation. + * @return the updated resource. + */ + SummaryLogs apply(Context context); + } + + /** + * The SummaryLogs update stages. + */ + interface UpdateStages { + /** + * The stage of the SummaryLogs update allowing to specify ruleType. + */ + interface WithRuleType { + /** + * Specifies the ruleType property: SummaryRules rule type: User.. + * + * @param ruleType SummaryRules rule type: User. + * @return the next definition stage. + */ + Update withRuleType(RuleTypeEnum ruleType); + } + + /** + * The stage of the SummaryLogs update allowing to specify displayName. + */ + interface WithDisplayName { + /** + * Specifies the displayName property: The display name of the Summary rule.. + * + * @param displayName The display name of the Summary rule. + * @return the next definition stage. + */ + Update withDisplayName(String displayName); + } + + /** + * The stage of the SummaryLogs update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: The description of the Summary rule.. + * + * @param description The description of the Summary rule. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the SummaryLogs update allowing to specify ruleDefinition. + */ + interface WithRuleDefinition { + /** + * Specifies the ruleDefinition property: Rule definition parameters.. + * + * @param ruleDefinition Rule definition parameters. + * @return the next definition stage. + */ + Update withRuleDefinition(RuleDefinition ruleDefinition); + } + } + + /** + * Refreshes the resource to sync with Azure. + * + * @return the refreshed resource. + */ + SummaryLogs refresh(); + + /** + * Refreshes the resource to sync with Azure. + * + * @param context The context to associate with this operation. + * @return the refreshed resource. + */ + SummaryLogs refresh(Context context); + + /** + * Starts an inactive Summary rule. + * + * @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 start(); + + /** + * Starts an inactive Summary rule. + * + * @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 start(Context context); + + /** + * Stops an active Summary rule. + * + * @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 stopWithResponse(Context context); + + /** + * Stops an active Summary rule. + * + * @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 stop(); + + /** + * Retries a failed Summary rule bin. + * + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBin(SummaryLogsRetryBin parameters); + + /** + * Retries a failed Summary rule bin. + * + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBin(SummaryLogsRetryBin parameters, Context context); +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionListResult.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsListResult.java similarity index 50% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionListResult.java rename to sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsListResult.java index d673782c41df..ddae71e9904c 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionListResult.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsListResult.java @@ -2,60 +2,60 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.subscription.models; +package com.azure.resourcemanager.loganalytics.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 com.azure.resourcemanager.subscription.fluent.models.SubscriptionInner; +import com.azure.resourcemanager.loganalytics.fluent.models.SummaryLogsInner; import java.io.IOException; import java.util.List; /** - * Subscription list operation response. + * The list Summary rule operation response. */ @Fluent -public final class SubscriptionListResult implements JsonSerializable { +public final class SummaryLogsListResult implements JsonSerializable { /* - * An array of subscriptions. + * A list of Summary rules. */ - private List value; + private List value; /* - * The URL to get the next set of results. + * URL to retrieve the next set of operation list results, if available. */ private String nextLink; /** - * Creates an instance of SubscriptionListResult class. + * Creates an instance of SummaryLogsListResult class. */ - public SubscriptionListResult() { + public SummaryLogsListResult() { } /** - * Get the value property: An array of subscriptions. + * Get the value property: A list of Summary rules. * * @return the value value. */ - public List value() { + public List value() { return this.value; } /** - * Set the value property: An array of subscriptions. + * Set the value property: A list of Summary rules. * * @param value the value value to set. - * @return the SubscriptionListResult object itself. + * @return the SummaryLogsListResult object itself. */ - public SubscriptionListResult withValue(List value) { + public SummaryLogsListResult withValue(List value) { this.value = value; return this; } /** - * Get the nextLink property: The URL to get the next set of results. + * Get the nextLink property: URL to retrieve the next set of operation list results, if available. * * @return the nextLink value. */ @@ -63,17 +63,6 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: The URL to get the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the SubscriptionListResult object itself. - */ - public SubscriptionListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * @@ -92,36 +81,35 @@ public void validate() { 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 SubscriptionListResult from the JsonReader. + * Reads an instance of SummaryLogsListResult from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionListResult if the JsonReader was pointing to an instance of it, or null if it + * @return An instance of SummaryLogsListResult 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 SubscriptionListResult. + * @throws IOException If an error occurs while reading the SummaryLogsListResult. */ - public static SubscriptionListResult fromJson(JsonReader jsonReader) throws IOException { + public static SummaryLogsListResult fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - SubscriptionListResult deserializedSubscriptionListResult = new SubscriptionListResult(); + SummaryLogsListResult deserializedSummaryLogsListResult = new SummaryLogsListResult(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> SubscriptionInner.fromJson(reader1)); - deserializedSubscriptionListResult.value = value; + List value = reader.readArray(reader1 -> SummaryLogsInner.fromJson(reader1)); + deserializedSummaryLogsListResult.value = value; } else if ("nextLink".equals(fieldName)) { - deserializedSubscriptionListResult.nextLink = reader.getString(); + deserializedSummaryLogsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedSubscriptionListResult; + return deserializedSummaryLogsListResult; }); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsOperations.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsOperations.java new file mode 100644 index 000000000000..08256a10029e --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsOperations.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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 SummaryLogsOperations. + */ +public interface SummaryLogsOperations { + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName); + + /** + * Gets all summary rules for the specified Log Analytics workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 all summary rules for the specified Log Analytics workspace as paginated response with + * {@link PagedIterable}. + */ + PagedIterable listByWorkspace(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + Response getWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 log Analytics workspace Summary rules. + */ + SummaryLogs get(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 delete(String resourceGroupName, String workspaceName, String summaryLogsName, Context context); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 start(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Starts an inactive Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 start(String resourceGroupName, String workspaceName, String summaryLogsName, Context context); + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 stopWithResponse(String resourceGroupName, String workspaceName, String summaryLogsName, + Context context); + + /** + * Stops an active Summary rule. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @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 stop(String resourceGroupName, String workspaceName, String summaryLogsName); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters); + + /** + * Retries a failed Summary rule bin. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param summaryLogsName The name of the summary logs. Must not contain '/'. + * @param parameters The parameters required to retry a Summary rule bin. + * @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 retryBin(String resourceGroupName, String workspaceName, String summaryLogsName, + SummaryLogsRetryBin parameters, Context context); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + SummaryLogs getById(String id); + + /** + * Gets Log Analytics workspace Summary rules. + * + * @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 log Analytics workspace Summary rules along with {@link Response}. + */ + Response getByIdWithResponse(String id, Context context); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @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); + + /** + * Deletes Log Analytics workspace Summary rules. + * + * @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. + */ + void deleteByIdWithResponse(String id, Context context); + + /** + * Begins definition for a new SummaryLogs resource. + * + * @param name resource name. + * @return the first stage of the new SummaryLogs definition. + */ + SummaryLogs.DefinitionStages.Blank define(String name); +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBin.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBin.java new file mode 100644 index 000000000000..a766e7736945 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBin.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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 retry a summary logs bin. + */ +@Fluent +public final class SummaryLogsRetryBin implements JsonSerializable { + /* + * Retry bin properties. + */ + private SummaryLogsRetryBinProperties properties; + + /** + * Creates an instance of SummaryLogsRetryBin class. + */ + public SummaryLogsRetryBin() { + } + + /** + * Get the properties property: Retry bin properties. + * + * @return the properties value. + */ + public SummaryLogsRetryBinProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Retry bin properties. + * + * @param properties the properties value to set. + * @return the SummaryLogsRetryBin object itself. + */ + public SummaryLogsRetryBin withProperties(SummaryLogsRetryBinProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryLogsRetryBin from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryLogsRetryBin 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 SummaryLogsRetryBin. + */ + public static SummaryLogsRetryBin fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryLogsRetryBin deserializedSummaryLogsRetryBin = new SummaryLogsRetryBin(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedSummaryLogsRetryBin.properties = SummaryLogsRetryBinProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryLogsRetryBin; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBinProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBinProperties.java new file mode 100644 index 000000000000..8b0ce563b9b2 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SummaryLogsRetryBinProperties.java @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +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; + +/** + * Properties for retrying a Summary rule bin. + */ +@Fluent +public final class SummaryLogsRetryBinProperties implements JsonSerializable { + /* + * The time (UTC) of the bin to retry. + */ + private OffsetDateTime retryBinStartTime; + + /** + * Creates an instance of SummaryLogsRetryBinProperties class. + */ + public SummaryLogsRetryBinProperties() { + } + + /** + * Get the retryBinStartTime property: The time (UTC) of the bin to retry. + * + * @return the retryBinStartTime value. + */ + public OffsetDateTime retryBinStartTime() { + return this.retryBinStartTime; + } + + /** + * Set the retryBinStartTime property: The time (UTC) of the bin to retry. + * + * @param retryBinStartTime the retryBinStartTime value to set. + * @return the SummaryLogsRetryBinProperties object itself. + */ + public SummaryLogsRetryBinProperties withRetryBinStartTime(OffsetDateTime retryBinStartTime) { + this.retryBinStartTime = retryBinStartTime; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (retryBinStartTime() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property retryBinStartTime in model SummaryLogsRetryBinProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(SummaryLogsRetryBinProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("retryBinStartTime", + this.retryBinStartTime == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.retryBinStartTime)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SummaryLogsRetryBinProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SummaryLogsRetryBinProperties 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 SummaryLogsRetryBinProperties. + */ + public static SummaryLogsRetryBinProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SummaryLogsRetryBinProperties deserializedSummaryLogsRetryBinProperties + = new SummaryLogsRetryBinProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("retryBinStartTime".equals(fieldName)) { + deserializedSummaryLogsRetryBinProperties.retryBinStartTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedSummaryLogsRetryBinProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SystemDataAutoGenerated.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SystemDataAutoGenerated.java deleted file mode 100644 index 6e27ad4d2842..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/SystemDataAutoGenerated.java +++ /dev/null @@ -1,242 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.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.time.format.DateTimeFormatter; - -/** - * Metadata pertaining to creation and last modification of the resource. - */ -@Fluent -public final class SystemDataAutoGenerated implements JsonSerializable { - /* - * The identity that created the resource. - */ - private String createdBy; - - /* - * The type of identity that created the resource. - */ - private CreatedByType createdByType; - - /* - * The timestamp of resource creation (UTC). - */ - private OffsetDateTime createdAt; - - /* - * The identity that last modified the resource. - */ - private String lastModifiedBy; - - /* - * The type of identity that last modified the resource. - */ - private CreatedByType lastModifiedByType; - - /* - * The timestamp of resource last modification (UTC) - */ - private OffsetDateTime lastModifiedAt; - - /** - * Creates an instance of SystemDataAutoGenerated class. - */ - public SystemDataAutoGenerated() { - } - - /** - * Get the createdBy property: The identity that created the resource. - * - * @return the createdBy value. - */ - public String createdBy() { - return this.createdBy; - } - - /** - * Set the createdBy property: The identity that created the resource. - * - * @param createdBy the createdBy value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withCreatedBy(String createdBy) { - this.createdBy = createdBy; - return this; - } - - /** - * Get the createdByType property: The type of identity that created the resource. - * - * @return the createdByType value. - */ - public CreatedByType createdByType() { - return this.createdByType; - } - - /** - * Set the createdByType property: The type of identity that created the resource. - * - * @param createdByType the createdByType value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withCreatedByType(CreatedByType createdByType) { - this.createdByType = createdByType; - return this; - } - - /** - * Get the createdAt property: The timestamp of resource creation (UTC). - * - * @return the createdAt value. - */ - public OffsetDateTime createdAt() { - return this.createdAt; - } - - /** - * Set the createdAt property: The timestamp of resource creation (UTC). - * - * @param createdAt the createdAt value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withCreatedAt(OffsetDateTime createdAt) { - this.createdAt = createdAt; - return this; - } - - /** - * Get the lastModifiedBy property: The identity that last modified the resource. - * - * @return the lastModifiedBy value. - */ - public String lastModifiedBy() { - return this.lastModifiedBy; - } - - /** - * Set the lastModifiedBy property: The identity that last modified the resource. - * - * @param lastModifiedBy the lastModifiedBy value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withLastModifiedBy(String lastModifiedBy) { - this.lastModifiedBy = lastModifiedBy; - return this; - } - - /** - * Get the lastModifiedByType property: The type of identity that last modified the resource. - * - * @return the lastModifiedByType value. - */ - public CreatedByType lastModifiedByType() { - return this.lastModifiedByType; - } - - /** - * Set the lastModifiedByType property: The type of identity that last modified the resource. - * - * @param lastModifiedByType the lastModifiedByType value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withLastModifiedByType(CreatedByType lastModifiedByType) { - this.lastModifiedByType = lastModifiedByType; - return this; - } - - /** - * Get the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @return the lastModifiedAt value. - */ - public OffsetDateTime lastModifiedAt() { - return this.lastModifiedAt; - } - - /** - * Set the lastModifiedAt property: The timestamp of resource last modification (UTC). - * - * @param lastModifiedAt the lastModifiedAt value to set. - * @return the SystemDataAutoGenerated object itself. - */ - public SystemDataAutoGenerated withLastModifiedAt(OffsetDateTime lastModifiedAt) { - this.lastModifiedAt = lastModifiedAt; - return this; - } - - /** - * 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(); - jsonWriter.writeStringField("createdBy", this.createdBy); - jsonWriter.writeStringField("createdByType", this.createdByType == null ? null : this.createdByType.toString()); - jsonWriter.writeStringField("createdAt", - this.createdAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.createdAt)); - jsonWriter.writeStringField("lastModifiedBy", this.lastModifiedBy); - jsonWriter.writeStringField("lastModifiedByType", - this.lastModifiedByType == null ? null : this.lastModifiedByType.toString()); - jsonWriter.writeStringField("lastModifiedAt", - this.lastModifiedAt == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedAt)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SystemDataAutoGenerated from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SystemDataAutoGenerated 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 SystemDataAutoGenerated. - */ - public static SystemDataAutoGenerated fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SystemDataAutoGenerated deserializedSystemDataAutoGenerated = new SystemDataAutoGenerated(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("createdBy".equals(fieldName)) { - deserializedSystemDataAutoGenerated.createdBy = reader.getString(); - } else if ("createdByType".equals(fieldName)) { - deserializedSystemDataAutoGenerated.createdByType = CreatedByType.fromString(reader.getString()); - } else if ("createdAt".equals(fieldName)) { - deserializedSystemDataAutoGenerated.createdAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("lastModifiedBy".equals(fieldName)) { - deserializedSystemDataAutoGenerated.lastModifiedBy = reader.getString(); - } else if ("lastModifiedByType".equals(fieldName)) { - deserializedSystemDataAutoGenerated.lastModifiedByType - = CreatedByType.fromString(reader.getString()); - } else if ("lastModifiedAt".equals(fieldName)) { - deserializedSystemDataAutoGenerated.lastModifiedAt = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else { - reader.skipChildren(); - } - } - - return deserializedSystemDataAutoGenerated; - }); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java index a132b06efdf1..bb6b889337dc 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Table.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.http.rest.Response; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.TableInner; @@ -38,11 +39,12 @@ public interface Table { * * @return the systemData value. */ - SystemDataAutoGenerated systemData(); + SystemData systemData(); /** - * Gets the retentionInDays property: The table retention in days, between 4 and 730. Setting this property to -1 - * will default to the workspace retention. + * Gets the retentionInDays property: In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read only + * property. * * @return the retentionInDays value. */ @@ -50,14 +52,14 @@ public interface Table { /** * Gets the totalRetentionInDays property: The table total retention in days, between 4 and 4383. Setting this - * property to -1 will default to table retention. + * property to -1 will default to retentionInDays. * * @return the totalRetentionInDays value. */ Integer totalRetentionInDays(); /** - * Gets the archiveRetentionInDays property: The table data archive retention in days. Calculated as + * Gets the archiveRetentionInDays property: The tables long-term retention in days. Calculated as * (totalRetentionInDays-retentionInDays). * * @return the archiveRetentionInDays value. @@ -204,11 +206,13 @@ interface WithCreate extends DefinitionStages.WithRetentionInDays, DefinitionSta */ interface WithRetentionInDays { /** - * Specifies the retentionInDays property: The table retention in days, between 4 and 730. Setting this - * property to -1 will default to the workspace retention.. + * Specifies the retentionInDays property: In Analytics table: the tables analytics retention in days, + * between 4 and 730. Setting this property to -1 will default to the workspace retention. In Basic and + * Auxiliary table: read only property.. * - * @param retentionInDays The table retention in days, between 4 and 730. Setting this property to -1 will - * default to the workspace retention. + * @param retentionInDays In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read + * only property. * @return the next definition stage. */ WithCreate withRetentionInDays(Integer retentionInDays); @@ -220,10 +224,10 @@ interface WithRetentionInDays { interface WithTotalRetentionInDays { /** * Specifies the totalRetentionInDays property: The table total retention in days, between 4 and 4383. - * Setting this property to -1 will default to table retention.. + * Setting this property to -1 will default to retentionInDays.. * * @param totalRetentionInDays The table total retention in days, between 4 and 4383. Setting this property - * to -1 will default to table retention. + * to -1 will default to retentionInDays. * @return the next definition stage. */ WithCreate withTotalRetentionInDays(Integer totalRetentionInDays); @@ -320,11 +324,13 @@ interface UpdateStages { */ interface WithRetentionInDays { /** - * Specifies the retentionInDays property: The table retention in days, between 4 and 730. Setting this - * property to -1 will default to the workspace retention.. + * Specifies the retentionInDays property: In Analytics table: the tables analytics retention in days, + * between 4 and 730. Setting this property to -1 will default to the workspace retention. In Basic and + * Auxiliary table: read only property.. * - * @param retentionInDays The table retention in days, between 4 and 730. Setting this property to -1 will - * default to the workspace retention. + * @param retentionInDays In Analytics table: the tables analytics retention in days, between 4 and 730. + * Setting this property to -1 will default to the workspace retention. In Basic and Auxiliary table: read + * only property. * @return the next definition stage. */ Update withRetentionInDays(Integer retentionInDays); @@ -336,10 +342,10 @@ interface WithRetentionInDays { interface WithTotalRetentionInDays { /** * Specifies the totalRetentionInDays property: The table total retention in days, between 4 and 4383. - * Setting this property to -1 will default to table retention.. + * Setting this property to -1 will default to retentionInDays.. * * @param totalRetentionInDays The table total retention in days, between 4 and 4383. Setting this property - * to -1 will default to table retention. + * to -1 will default to retentionInDays. * @return the next definition stage. */ Update withTotalRetentionInDays(Integer totalRetentionInDays); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TablePlanEnum.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TablePlanEnum.java index 6f506423c429..7eeece0a7632 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TablePlanEnum.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TablePlanEnum.java @@ -21,6 +21,11 @@ public final class TablePlanEnum extends ExpandableStringEnum { */ public static final TablePlanEnum ANALYTICS = fromString("Analytics"); + /** + * Static value Auxiliary for TablePlanEnum. + */ + public static final TablePlanEnum AUXILIARY = fromString("Auxiliary"); + /** * Creates a new instance of TablePlanEnum value. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TimeSelectorEnum.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TimeSelectorEnum.java new file mode 100644 index 000000000000..3f038ed82aa0 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/TimeSelectorEnum.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The time cursor used in Summary rules bins processing, e.g. TimeGenerated. + */ +public final class TimeSelectorEnum extends ExpandableStringEnum { + /** + * Static value TimeGenerated for TimeSelectorEnum. + */ + public static final TimeSelectorEnum TIME_GENERATED = fromString("TimeGenerated"); + + /** + * Creates a new instance of TimeSelectorEnum value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public TimeSelectorEnum() { + } + + /** + * Creates or finds a TimeSelectorEnum from its string representation. + * + * @param name a name to look for. + * @return the corresponding TimeSelectorEnum. + */ + public static TimeSelectorEnum fromString(String name) { + return fromString(name, TimeSelectorEnum.class); + } + + /** + * Gets known TimeSelectorEnum values. + * + * @return known TimeSelectorEnum values. + */ + public static Collection values() { + return values(TimeSelectorEnum.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java index 1565231d5312..9d7cd91cc51a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspace.java @@ -5,8 +5,10 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.management.Region; +import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -61,7 +63,7 @@ public interface Workspace { * * @return the systemData value. */ - SystemDataAutoGenerated systemData(); + SystemData systemData(); /** * Gets the etag property: The etag of the workspace. @@ -111,14 +113,14 @@ public interface Workspace { * * @return the createdDate value. */ - String createdDate(); + OffsetDateTime createdDate(); /** * Gets the modifiedDate property: Workspace modification date. * * @return the modifiedDate value. */ - String modifiedDate(); + OffsetDateTime modifiedDate(); /** * Gets the publicNetworkAccessForIngestion property: The network access type for accessing Log Analytics ingestion. @@ -164,6 +166,20 @@ public interface Workspace { */ String defaultDataCollectionRuleResourceId(); + /** + * Gets the replication property: workspace replication properties. + * + * @return the replication value. + */ + WorkspaceReplicationProperties replication(); + + /** + * Gets the failover property: workspace failover properties. + * + * @return the failover value. + */ + WorkspaceFailoverProperties failover(); + /** * Gets the region of the resource. * @@ -251,7 +267,8 @@ interface WithCreate extends DefinitionStages.WithTags, DefinitionStages.WithIde DefinitionStages.WithEtag, DefinitionStages.WithSku, DefinitionStages.WithRetentionInDays, DefinitionStages.WithWorkspaceCapping, DefinitionStages.WithPublicNetworkAccessForIngestion, DefinitionStages.WithPublicNetworkAccessForQuery, DefinitionStages.WithForceCmkForQuery, - DefinitionStages.WithFeatures, DefinitionStages.WithDefaultDataCollectionRuleResourceId { + DefinitionStages.WithFeatures, DefinitionStages.WithDefaultDataCollectionRuleResourceId, + DefinitionStages.WithReplication, DefinitionStages.WithFailover { /** * Executes the create request. * @@ -419,6 +436,32 @@ interface WithDefaultDataCollectionRuleResourceId { */ WithCreate withDefaultDataCollectionRuleResourceId(String defaultDataCollectionRuleResourceId); } + + /** + * The stage of the Workspace definition allowing to specify replication. + */ + interface WithReplication { + /** + * Specifies the replication property: workspace replication properties.. + * + * @param replication workspace replication properties. + * @return the next definition stage. + */ + WithCreate withReplication(WorkspaceReplicationProperties replication); + } + + /** + * The stage of the Workspace definition allowing to specify failover. + */ + interface WithFailover { + /** + * Specifies the failover property: workspace failover properties.. + * + * @param failover workspace failover properties. + * @return the next definition stage. + */ + WithCreate withFailover(WorkspaceFailoverProperties failover); + } } /** @@ -435,7 +478,7 @@ interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, Updat UpdateStages.WithRetentionInDays, UpdateStages.WithWorkspaceCapping, UpdateStages.WithPublicNetworkAccessForIngestion, UpdateStages.WithPublicNetworkAccessForQuery, UpdateStages.WithForceCmkForQuery, UpdateStages.WithFeatures, - UpdateStages.WithDefaultDataCollectionRuleResourceId { + UpdateStages.WithDefaultDataCollectionRuleResourceId, UpdateStages.WithReplication, UpdateStages.WithFailover { /** * Executes the update request. * @@ -594,6 +637,32 @@ interface WithDefaultDataCollectionRuleResourceId { */ Update withDefaultDataCollectionRuleResourceId(String defaultDataCollectionRuleResourceId); } + + /** + * The stage of the Workspace update allowing to specify replication. + */ + interface WithReplication { + /** + * Specifies the replication property: workspace replication properties.. + * + * @param replication workspace replication properties. + * @return the next definition stage. + */ + Update withReplication(WorkspaceReplicationProperties replication); + } + + /** + * The stage of the Workspace update allowing to specify failover. + */ + interface WithFailover { + /** + * Specifies the failover property: workspace failover properties.. + * + * @param failover workspace failover properties. + * @return the next definition stage. + */ + Update withFailover(WorkspaceFailoverProperties failover); + } } /** diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverProperties.java new file mode 100644 index 000000000000..2c21e573155e --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverProperties.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * The failover state of the replication. + */ +@Immutable +public final class WorkspaceFailoverProperties implements JsonSerializable { + /* + * The failover state of the replication. + */ + private WorkspaceFailoverState state; + + /* + * The last time when the failover state was updated. + */ + private OffsetDateTime lastModifiedDate; + + /** + * Creates an instance of WorkspaceFailoverProperties class. + */ + public WorkspaceFailoverProperties() { + } + + /** + * Get the state property: The failover state of the replication. + * + * @return the state value. + */ + public WorkspaceFailoverState state() { + return this.state; + } + + /** + * Get the lastModifiedDate property: The last time when the failover state was updated. + * + * @return the lastModifiedDate value. + */ + public OffsetDateTime lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * 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 WorkspaceFailoverProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceFailoverProperties 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 WorkspaceFailoverProperties. + */ + public static WorkspaceFailoverProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceFailoverProperties deserializedWorkspaceFailoverProperties = new WorkspaceFailoverProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("state".equals(fieldName)) { + deserializedWorkspaceFailoverProperties.state + = WorkspaceFailoverState.fromString(reader.getString()); + } else if ("lastModifiedDate".equals(fieldName)) { + deserializedWorkspaceFailoverProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceFailoverProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverState.java new file mode 100644 index 000000000000..9e737290b651 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFailoverState.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The failover state of the replication. + */ +public final class WorkspaceFailoverState extends ExpandableStringEnum { + /** + * Static value Inactive for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState INACTIVE = fromString("Inactive"); + + /** + * Static value Activating for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState ACTIVATING = fromString("Activating"); + + /** + * Static value Active for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState ACTIVE = fromString("Active"); + + /** + * Static value Deactivating for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState DEACTIVATING = fromString("Deactivating"); + + /** + * Static value Failed for WorkspaceFailoverState. + */ + public static final WorkspaceFailoverState FAILED = fromString("Failed"); + + /** + * Creates a new instance of WorkspaceFailoverState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceFailoverState() { + } + + /** + * Creates or finds a WorkspaceFailoverState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceFailoverState. + */ + public static WorkspaceFailoverState fromString(String name) { + return fromString(name, WorkspaceFailoverState.class); + } + + /** + * Gets known WorkspaceFailoverState values. + * + * @return known WorkspaceFailoverState values. + */ + public static Collection values() { + return values(WorkspaceFailoverState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java index a9df6beb1b9b..e99d2e623119 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceFeatures.java @@ -11,6 +11,7 @@ import com.azure.json.JsonWriter; import java.io.IOException; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; /** @@ -43,6 +44,17 @@ public final class WorkspaceFeatures implements JsonSerializable associations; + /* * Workspace features. */ @@ -157,6 +169,26 @@ public WorkspaceFeatures withDisableLocalAuth(Boolean disableLocalAuth) { return this; } + /** + * Get the unifiedSentinelBillingOnly property: An indication if the specify workspace is limited to sentinel's + * unified billing model only. + * + * @return the unifiedSentinelBillingOnly value. + */ + public Boolean unifiedSentinelBillingOnly() { + return this.unifiedSentinelBillingOnly; + } + + /** + * Get the associations property: List of associations for the workspace. Indicates if the workspace is associated + * with any of the following experiences: MDC, Sentinel, SentinelGraph, etc. + * + * @return the associations value. + */ + public List associations() { + return this.associations; + } + /** * Get the additionalProperties property: Workspace features. * @@ -233,6 +265,12 @@ public static WorkspaceFeatures fromJson(JsonReader jsonReader) throws IOExcepti deserializedWorkspaceFeatures.clusterResourceId = reader.getString(); } else if ("disableLocalAuth".equals(fieldName)) { deserializedWorkspaceFeatures.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); + } else if ("unifiedSentinelBillingOnly".equals(fieldName)) { + deserializedWorkspaceFeatures.unifiedSentinelBillingOnly + = reader.getNullable(JsonReader::getBoolean); + } else if ("associations".equals(fieldName)) { + List associations = reader.readArray(reader1 -> reader1.getString()); + deserializedWorkspaceFeatures.associations = associations; } else { if (additionalProperties == null) { additionalProperties = new LinkedHashMap<>(); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java index a535826fce8c..cc71120c2510 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePatch.java @@ -10,6 +10,7 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceProperties; import java.io.IOException; +import java.time.OffsetDateTime; import java.util.List; import java.util.Map; @@ -242,7 +243,7 @@ public WorkspacePatch withWorkspaceCapping(WorkspaceCapping workspaceCapping) { * * @return the createdDate value. */ - public String createdDate() { + public OffsetDateTime createdDate() { return this.innerProperties() == null ? null : this.innerProperties().createdDate(); } @@ -251,7 +252,7 @@ public String createdDate() { * * @return the modifiedDate value. */ - public String modifiedDate() { + public OffsetDateTime modifiedDate() { return this.innerProperties() == null ? null : this.innerProperties().modifiedDate(); } @@ -383,6 +384,52 @@ public WorkspacePatch withDefaultDataCollectionRuleResourceId(String defaultData return this; } + /** + * Get the replication property: workspace replication properties. + * + * @return the replication value. + */ + public WorkspaceReplicationProperties replication() { + return this.innerProperties() == null ? null : this.innerProperties().replication(); + } + + /** + * Set the replication property: workspace replication properties. + * + * @param replication the replication value to set. + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withReplication(WorkspaceReplicationProperties replication) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withReplication(replication); + return this; + } + + /** + * Get the failover property: workspace failover properties. + * + * @return the failover value. + */ + public WorkspaceFailoverProperties failover() { + return this.innerProperties() == null ? null : this.innerProperties().failover(); + } + + /** + * Set the failover property: workspace failover properties. + * + * @param failover the failover value to set. + * @return the WorkspacePatch object itself. + */ + public WorkspacePatch withFailover(WorkspaceFailoverProperties failover) { + if (this.innerProperties() == null) { + this.innerProperties = new WorkspaceProperties(); + } + this.innerProperties().withFailover(failover); + return this; + } + /** * Validates the instance. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePurgeBodyFilters.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePurgeBodyFilters.java index dc6ff302ce36..ea933e471b37 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePurgeBodyFilters.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspacePurgeBodyFilters.java @@ -148,7 +148,9 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("column", this.column); jsonWriter.writeStringField("operator", this.operator); - jsonWriter.writeUntypedField("value", this.value); + if (this.value != null) { + jsonWriter.writeUntypedField("value", this.value); + } jsonWriter.writeStringField("key", this.key); return jsonWriter.writeEndObject(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationProperties.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationProperties.java new file mode 100644 index 000000000000..3221198b5a6a --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationProperties.java @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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; + +/** + * Workspace replication properties. + */ +@Fluent +public final class WorkspaceReplicationProperties implements JsonSerializable { + /* + * The location of the replication. + */ + private String location; + + /* + * Specifies whether the replication is enabled or not. When true, workspace configuration and data is replicated to + * the specified location. If replication is been enabled, location must be provided. + */ + private Boolean enabled; + + /* + * The provisioning state of the replication. + */ + private WorkspaceReplicationState provisioningState; + + /* + * The last time when the replication was enabled. + */ + private OffsetDateTime createdDate; + + /* + * The last time when the replication was updated. + */ + private OffsetDateTime lastModifiedDate; + + /** + * Creates an instance of WorkspaceReplicationProperties class. + */ + public WorkspaceReplicationProperties() { + } + + /** + * Get the location property: The location of the replication. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the replication. + * + * @param location the location value to set. + * @return the WorkspaceReplicationProperties object itself. + */ + public WorkspaceReplicationProperties withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the enabled property: Specifies whether the replication is enabled or not. When true, workspace configuration + * and data is replicated to the specified location. If replication is been enabled, location must be provided. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Specifies whether the replication is enabled or not. When true, workspace configuration + * and data is replicated to the specified location. If replication is been enabled, location must be provided. + * + * @param enabled the enabled value to set. + * @return the WorkspaceReplicationProperties object itself. + */ + public WorkspaceReplicationProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the replication. + * + * @return the provisioningState value. + */ + public WorkspaceReplicationState provisioningState() { + return this.provisioningState; + } + + /** + * Get the createdDate property: The last time when the replication was enabled. + * + * @return the createdDate value. + */ + public OffsetDateTime createdDate() { + return this.createdDate; + } + + /** + * Get the lastModifiedDate property: The last time when the replication was updated. + * + * @return the lastModifiedDate value. + */ + public OffsetDateTime lastModifiedDate() { + return this.lastModifiedDate; + } + + /** + * 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(); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeBooleanField("enabled", this.enabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of WorkspaceReplicationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of WorkspaceReplicationProperties 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 WorkspaceReplicationProperties. + */ + public static WorkspaceReplicationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + WorkspaceReplicationProperties deserializedWorkspaceReplicationProperties + = new WorkspaceReplicationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("location".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.location = reader.getString(); + } else if ("enabled".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("provisioningState".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.provisioningState + = WorkspaceReplicationState.fromString(reader.getString()); + } else if ("createdDate".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.createdDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("lastModifiedDate".equals(fieldName)) { + deserializedWorkspaceReplicationProperties.lastModifiedDate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedWorkspaceReplicationProperties; + }); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationState.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationState.java new file mode 100644 index 000000000000..3012cd8a21ed --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceReplicationState.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the replication. + */ +public final class WorkspaceReplicationState extends ExpandableStringEnum { + /** + * Static value Succeeded for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value EnableRequested for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ENABLE_REQUESTED = fromString("EnableRequested"); + + /** + * Static value Enabling for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ENABLING = fromString("Enabling"); + + /** + * Static value DisableRequested for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState DISABLE_REQUESTED = fromString("DisableRequested"); + + /** + * Static value Disabling for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState DISABLING = fromString("Disabling"); + + /** + * Static value RollbackRequested for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ROLLBACK_REQUESTED = fromString("RollbackRequested"); + + /** + * Static value RollingBack for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState ROLLING_BACK = fromString("RollingBack"); + + /** + * Static value Failed for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState FAILED = fromString("Failed"); + + /** + * Static value Canceled for WorkspaceReplicationState. + */ + public static final WorkspaceReplicationState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of WorkspaceReplicationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public WorkspaceReplicationState() { + } + + /** + * Creates or finds a WorkspaceReplicationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding WorkspaceReplicationState. + */ + public static WorkspaceReplicationState fromString(String name) { + return fromString(name, WorkspaceReplicationState.class); + } + + /** + * Gets known WorkspaceReplicationState values. + * + * @return known WorkspaceReplicationState values. + */ + public static Collection values() { + return values(WorkspaceReplicationState.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java index 2d7a1192b4f8..af77ce68904e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/WorkspaceSku.java @@ -5,12 +5,14 @@ package com.azure.resourcemanager.loganalytics.models; import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; 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; /** * The SKU (tier) of a workspace. @@ -25,12 +27,12 @@ public final class WorkspaceSku implements JsonSerializable { /* * The capacity reservation level in GB for this workspace, when CapacityReservation sku is selected. */ - private CapacityReservationLevel capacityReservationLevel; + private Integer capacityReservationLevel; /* * The last time when the sku was updated. */ - private String lastSkuUpdate; + private OffsetDateTime lastSkuUpdate; /** * Creates an instance of WorkspaceSku class. @@ -64,7 +66,7 @@ public WorkspaceSku withName(WorkspaceSkuNameEnum name) { * * @return the capacityReservationLevel value. */ - public CapacityReservationLevel capacityReservationLevel() { + public Integer capacityReservationLevel() { return this.capacityReservationLevel; } @@ -75,7 +77,7 @@ public CapacityReservationLevel capacityReservationLevel() { * @param capacityReservationLevel the capacityReservationLevel value to set. * @return the WorkspaceSku object itself. */ - public WorkspaceSku withCapacityReservationLevel(CapacityReservationLevel capacityReservationLevel) { + public WorkspaceSku withCapacityReservationLevel(Integer capacityReservationLevel) { this.capacityReservationLevel = capacityReservationLevel; return this; } @@ -85,7 +87,7 @@ public WorkspaceSku withCapacityReservationLevel(CapacityReservationLevel capaci * * @return the lastSkuUpdate value. */ - public String lastSkuUpdate() { + public OffsetDateTime lastSkuUpdate() { return this.lastSkuUpdate; } @@ -110,8 +112,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name == null ? null : this.name.toString()); - jsonWriter.writeNumberField("capacityReservationLevel", - this.capacityReservationLevel == null ? null : this.capacityReservationLevel.toInt()); + jsonWriter.writeNumberField("capacityReservationLevel", this.capacityReservationLevel); return jsonWriter.writeEndObject(); } @@ -134,10 +135,10 @@ public static WorkspaceSku fromJson(JsonReader jsonReader) throws IOException { if ("name".equals(fieldName)) { deserializedWorkspaceSku.name = WorkspaceSkuNameEnum.fromString(reader.getString()); } else if ("capacityReservationLevel".equals(fieldName)) { - deserializedWorkspaceSku.capacityReservationLevel - = CapacityReservationLevel.fromInt(reader.getInt()); + deserializedWorkspaceSku.capacityReservationLevel = reader.getNullable(JsonReader::getInt); } else if ("lastSkuUpdate".equals(fieldName)) { - deserializedWorkspaceSku.lastSkuUpdate = reader.getString(); + deserializedWorkspaceSku.lastSkuUpdate = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else { reader.skipChildren(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java index aded531c69b2..c83b5b4f9374 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/java/com/azure/resourcemanager/loganalytics/models/Workspaces.java @@ -109,6 +109,149 @@ public interface Workspaces { */ Workspace getByResourceGroup(String resourceGroupName, String workspaceName); + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failover(String resourceGroupName, String location, String workspaceName); + + /** + * Activates failover for the specified workspace. + * + * The specified replication location must match the location of the enabled replication for this workspace. The + * failover operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can be + * checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param location The name of the Azure region. + * @param workspaceName The name of the workspace. + * @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 failover(String resourceGroupName, String location, String workspaceName, Context context); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failback(String resourceGroupName, String workspaceName); + + /** + * Deactivates failover for the specified workspace. + * + * The failback operation is asynchronous and can take up to 30 minutes to complete. The status of the operation can + * be checked using the operationId returned in the response. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 failback(String resourceGroupName, String workspaceName, Context context); + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + PagedIterable listNsp(String resourceGroupName, String workspaceName); + + /** + * Gets a list of NSP configurations for specified workspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @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 of NSP configurations for specified workspace as paginated response with {@link PagedIterable}. + */ + PagedIterable listNsp(String resourceGroupName, String workspaceName, + Context context); + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration along with {@link Response}. + */ + Response getNspWithResponse(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Gets a network security perimeter configuration. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 network security perimeter configuration. + */ + NetworkSecurityPerimeterConfiguration getNsp(String resourceGroupName, String workspaceName, + String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 reconcileNsp(String resourceGroupName, String workspaceName, String networkSecurityPerimeterConfigurationName); + + /** + * Reconcile network security perimeter configuration for Workspace resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param workspaceName The name of the workspace. + * @param networkSecurityPerimeterConfigurationName The name for a network security perimeter configuration. + * @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 reconcileNsp(String resourceGroupName, String workspaceName, String networkSecurityPerimeterConfigurationName, + Context context); + /** * Gets a workspace instance. * diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loganalytics/proxy-config.json b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loganalytics/proxy-config.json index 96beaa4260d6..207d3ba1bca3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loganalytics/proxy-config.json +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-loganalytics/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.loganalytics.implementation.AvailableServiceTiersClientImpl$AvailableServiceTiersService"],["com.azure.resourcemanager.loganalytics.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.loganalytics.implementation.DataExportsClientImpl$DataExportsService"],["com.azure.resourcemanager.loganalytics.implementation.DataSourcesClientImpl$DataSourcesService"],["com.azure.resourcemanager.loganalytics.implementation.DeletedWorkspacesClientImpl$DeletedWorkspacesService"],["com.azure.resourcemanager.loganalytics.implementation.GatewaysClientImpl$GatewaysService"],["com.azure.resourcemanager.loganalytics.implementation.IntelligencePacksClientImpl$IntelligencePacksService"],["com.azure.resourcemanager.loganalytics.implementation.LinkedServicesClientImpl$LinkedServicesService"],["com.azure.resourcemanager.loganalytics.implementation.LinkedStorageAccountsClientImpl$LinkedStorageAccountsService"],["com.azure.resourcemanager.loganalytics.implementation.ManagementGroupsClientImpl$ManagementGroupsService"],["com.azure.resourcemanager.loganalytics.implementation.OperationStatusesClientImpl$OperationStatusesService"],["com.azure.resourcemanager.loganalytics.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.loganalytics.implementation.QueriesClientImpl$QueriesService"],["com.azure.resourcemanager.loganalytics.implementation.QueryPacksClientImpl$QueryPacksService"],["com.azure.resourcemanager.loganalytics.implementation.SavedSearchesClientImpl$SavedSearchesService"],["com.azure.resourcemanager.loganalytics.implementation.SchemasClientImpl$SchemasService"],["com.azure.resourcemanager.loganalytics.implementation.SharedKeysOperationsClientImpl$SharedKeysOperationsService"],["com.azure.resourcemanager.loganalytics.implementation.StorageInsightConfigsClientImpl$StorageInsightConfigsService"],["com.azure.resourcemanager.loganalytics.implementation.TablesClientImpl$TablesService"],["com.azure.resourcemanager.loganalytics.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.loganalytics.implementation.WorkspacePurgesClientImpl$WorkspacePurgesService"],["com.azure.resourcemanager.loganalytics.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file +[["com.azure.resourcemanager.loganalytics.implementation.AvailableServiceTiersClientImpl$AvailableServiceTiersService"],["com.azure.resourcemanager.loganalytics.implementation.ClustersClientImpl$ClustersService"],["com.azure.resourcemanager.loganalytics.implementation.DataExportsClientImpl$DataExportsService"],["com.azure.resourcemanager.loganalytics.implementation.DataSourcesClientImpl$DataSourcesService"],["com.azure.resourcemanager.loganalytics.implementation.DeletedWorkspacesClientImpl$DeletedWorkspacesService"],["com.azure.resourcemanager.loganalytics.implementation.GatewaysClientImpl$GatewaysService"],["com.azure.resourcemanager.loganalytics.implementation.IntelligencePacksClientImpl$IntelligencePacksService"],["com.azure.resourcemanager.loganalytics.implementation.LinkedServicesClientImpl$LinkedServicesService"],["com.azure.resourcemanager.loganalytics.implementation.LinkedStorageAccountsClientImpl$LinkedStorageAccountsService"],["com.azure.resourcemanager.loganalytics.implementation.ManagementGroupsClientImpl$ManagementGroupsService"],["com.azure.resourcemanager.loganalytics.implementation.OperationStatusesClientImpl$OperationStatusesService"],["com.azure.resourcemanager.loganalytics.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.loganalytics.implementation.QueriesClientImpl$QueriesService"],["com.azure.resourcemanager.loganalytics.implementation.QueryPacksClientImpl$QueryPacksService"],["com.azure.resourcemanager.loganalytics.implementation.SavedSearchesClientImpl$SavedSearchesService"],["com.azure.resourcemanager.loganalytics.implementation.SchemasClientImpl$SchemasService"],["com.azure.resourcemanager.loganalytics.implementation.SharedKeysOperationsClientImpl$SharedKeysOperationsService"],["com.azure.resourcemanager.loganalytics.implementation.StorageInsightConfigsClientImpl$StorageInsightConfigsService"],["com.azure.resourcemanager.loganalytics.implementation.SummaryLogsOperationsClientImpl$SummaryLogsOperationsService"],["com.azure.resourcemanager.loganalytics.implementation.TablesClientImpl$TablesService"],["com.azure.resourcemanager.loganalytics.implementation.UsagesClientImpl$UsagesService"],["com.azure.resourcemanager.loganalytics.implementation.WorkspacePurgesClientImpl$WorkspacePurgesService"],["com.azure.resourcemanager.loganalytics.implementation.WorkspacesClientImpl$WorkspacesService"]] \ No newline at end of file diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/azure-resourcemanager-loganalytics.properties b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/azure-resourcemanager-loganalytics.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/main/resources/azure-resourcemanager-loganalytics.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java index 6027c2a37478..911dda2f39eb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class AvailableServiceTiersListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesAvailableServiceTiers.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesAvailableServiceTiers.json */ /** * Sample code: AvailableServiceTiers. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java index cdf8a9d5ec19..baa8ce2485b5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersCreateOrUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.loganalytics.generated; -import com.azure.resourcemanager.loganalytics.models.Capacity; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; import java.util.HashMap; @@ -16,8 +15,8 @@ public final class ClustersCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersCreate.json */ /** * Sample code: ClustersCreate. @@ -27,11 +26,10 @@ public final class ClustersCreateOrUpdateSamples { public static void clustersCreate(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { manager.clusters() .define("oiautorest6685") - .withRegion("australiasoutheast") + .withRegion("eastus") .withExistingResourceGroup("oiautorest6685") .withTags(mapOf("tag1", "val1")) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withSku(new ClusterSku().withCapacity(100L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) .create(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java index 7e221b1ec4d4..8fe3dc91ea5d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteSamples.java @@ -10,8 +10,8 @@ public final class ClustersDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersDelete.json */ /** * Sample code: ClustersDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java index b7bb8dade85b..235514d4ac46 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class ClustersGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersGet.json */ /** * Sample code: ClustersGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java index 90e2eb2da761..159a51548e82 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class ClustersListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersListByResourceGroup.json */ /** * Sample code: ClustersGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java index 4444ec1d187b..42ff400e6863 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersListSamples.java @@ -10,8 +10,8 @@ public final class ClustersListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersSubscriptionList.json */ /** * Sample code: ClustersSubscriptionList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java index 49cc21a3ef7b..75b135ad8a7e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ClustersUpdateSamples.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.loganalytics.generated; -import com.azure.resourcemanager.loganalytics.models.Capacity; import com.azure.resourcemanager.loganalytics.models.Cluster; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; @@ -21,8 +20,8 @@ public final class ClustersUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * ClustersUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/ClustersUpdate.json */ /** * Sample code: ClustersPatch. @@ -39,8 +38,7 @@ public static void clustersPatch(com.azure.resourcemanager.loganalytics.LogAnaly .withUserAssignedIdentities(mapOf( "/subscriptions/53bc36c5-91e1-4d09-92c9-63b89e571926/resourcegroups/oiautorest6685/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myidentity", new UserAssignedIdentity()))) - .withSku(new ClusterSku().withCapacity(Capacity.ONE_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) + .withSku(new ClusterSku().withCapacity(1000L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION)) .withKeyVaultProperties(new KeyVaultProperties().withKeyVaultUri("fakeTokenPlaceholder") .withKeyName("fakeTokenPlaceholder") .withKeyVersion("fakeTokenPlaceholder") diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java index f7c685d67ebd..1f0b3ff72ea1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateSamples.java @@ -12,8 +12,8 @@ public final class DataExportsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportCreateOrUpdate.json */ /** * Sample code: DataExportCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java index 5abe36f0e084..eae061c19485 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteSamples.java @@ -10,8 +10,8 @@ public final class DataExportsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportDelete.json */ /** * Sample code: DataExportDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java index 5a2a5d2d9db2..c371b5126462 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetSamples.java @@ -10,8 +10,8 @@ public final class DataExportsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportGet.json */ /** * Sample code: DataExportGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java index 7ab637466708..a694e9c8e953 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class DataExportsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataExportListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataExportListByWorkspace.json */ /** * Sample code: DataExportGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java index 25d3636d4c2d..5aeed8a77a3b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateSamples.java @@ -15,8 +15,8 @@ public final class DataSourcesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesCreate.json */ /** * Sample code: DataSourcesCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java index a57cb035de24..097b75afe896 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteSamples.java @@ -10,8 +10,8 @@ public final class DataSourcesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesDelete.json */ /** * Sample code: DataSourcesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java index ee60fa9ca0f5..7ac3c72825d4 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetSamples.java @@ -10,8 +10,8 @@ public final class DataSourcesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesGet.json */ /** * Sample code: DataSourcesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java index 64401d4f00c1..252e6c639b1e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class DataSourcesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * DataSourcesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/DataSourcesListByWorkspace.json */ /** * Sample code: DataSourcesListByWorkspace. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java index f6a8ed6871cf..621b15cca97c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class DeletedWorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListByResourceGroup.json */ /** * Sample code: WorkspacesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java index ad2ba98f0b64..89a8ba8021c7 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListSamples.java @@ -10,8 +10,8 @@ public final class DeletedWorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSubscriptionList.json */ /** * Sample code: WorkspacesSubscriptionList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java index 28cc492db409..0ab01ac2110c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteSamples.java @@ -10,8 +10,8 @@ public final class GatewaysDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesGatewaysDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGatewaysDelete.json */ /** * Sample code: DeleteGateways. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java index 9eebdb756452..cc5836d941b7 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableSamples.java @@ -10,8 +10,8 @@ public final class IntelligencePacksDisableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDisableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDisableIntelligencePack.json */ /** * Sample code: IntelligencePacksDisable. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java index 250a7dba63b5..ad921383e09c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableSamples.java @@ -10,8 +10,8 @@ public final class IntelligencePacksEnableSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesEnableIntelligencePack.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesEnableIntelligencePack.json */ /** * Sample code: IntelligencePacksEnable. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java index 9b2a6df40974..a5e77a1a6180 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListSamples.java @@ -10,8 +10,8 @@ public final class IntelligencePacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListIntelligencePacks.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListIntelligencePacks.json */ /** * Sample code: IntelligencePacksList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java index 4073959caf7a..7f3f67f2240f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateSamples.java @@ -10,8 +10,8 @@ public final class LinkedServicesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesCreate.json */ /** * Sample code: LinkedServicesCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java index 02d4c9ba5ae8..868474b2ac6f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteSamples.java @@ -10,8 +10,8 @@ public final class LinkedServicesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesDelete.json */ /** * Sample code: LinkedServicesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java index f8d21b5a25d1..39852dc3b62f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetSamples.java @@ -10,8 +10,8 @@ public final class LinkedServicesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesGet.json */ /** * Sample code: LinkedServicesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java index 468ce3a9a4ef..be21065fff0c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class LinkedServicesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedServicesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedServicesListByWorkspace.json */ /** * Sample code: LinkedServicesListByWorkspace. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java index 5ec9c7aa0f5f..3cb1a6f23dfb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateSamples.java @@ -13,8 +13,8 @@ public final class LinkedStorageAccountsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsCreate.json */ /** * Sample code: LinkedStorageAccountsCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java index 1ce389516f57..c09d2da814b2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteSamples.java @@ -12,8 +12,8 @@ public final class LinkedStorageAccountsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsDelete.json */ /** * Sample code: LinkedStorageAccountsDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java index 9a0d884e4eaf..8daaa01f4b01 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetSamples.java @@ -12,8 +12,8 @@ public final class LinkedStorageAccountsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsGet.json */ /** * Sample code: LinkedStorageAccountsGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java index e1ae26a204db..fe8d0ae5dedd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class LinkedStorageAccountsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * LinkedStorageAccountsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/LinkedStorageAccountsListByWorkspace.json */ /** * Sample code: Gets list of linked storage accounts on a workspace. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java index 0cdabc9ffbb7..a5cae6936dfc 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListSamples.java @@ -10,8 +10,8 @@ public final class ManagementGroupsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListManagementGroups.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListManagementGroups.json */ /** * Sample code: WorkspacesListManagementGroups. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java index 853be869b15e..51a13f359a24 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationStatusesGetSamples.java @@ -10,8 +10,8 @@ public final class OperationStatusesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * OperationStatusesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/OperationStatusesGet.json */ /** * Sample code: Get specific operation status. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java index 374a6f18606b..5319828b6c8e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/OperationsListSamples.java @@ -10,8 +10,8 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * OperationsListByTenant.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/OperationsListByTenant.json */ /** * Sample code: Get specific operation status. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java index 387ca164856b..6a94f9eea7f9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteSamples.java @@ -10,8 +10,8 @@ public final class QueriesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesDelete.json */ /** * Sample code: QueryDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java index 064096ffaa8b..e9a55236fc7d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetSamples.java @@ -10,8 +10,8 @@ public final class QueriesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesGet.json */ /** * Sample code: QueryGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java index aa03bcd8a840..eb84f1e717ff 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesListSamples.java @@ -10,8 +10,8 @@ public final class QueriesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesList.json */ /** * Sample code: QueryList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java index 0ad9950cf1db..29d0da6c96b1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutSamples.java @@ -15,8 +15,8 @@ public final class QueriesPutSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesPut.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesPut.json */ /** * Sample code: QueryPut. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java index 95c9a54af48e..90defb533d09 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchSamples.java @@ -16,8 +16,8 @@ public final class QueriesSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesSearch.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesSearch.json */ /** * Sample code: QuerySearch. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java index aa5b79266f20..642be814b4cd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueriesUpdateSamples.java @@ -16,8 +16,8 @@ public final class QueriesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackQueriesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackQueriesUpdate.json */ /** * Sample code: QueryPatch. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java index c12df416effa..45c21ff9f308 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateSamples.java @@ -13,8 +13,8 @@ public final class QueryPacksCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksCreate.json */ /** * Sample code: QueryPackCreate. @@ -31,8 +31,8 @@ public static void queryPackCreate(com.azure.resourcemanager.loganalytics.LogAna /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksUpdate.json */ /** * Sample code: QueryPackUpdate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java index ea6b29b2488a..95d70e02bfc1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameSamples.java @@ -14,8 +14,8 @@ public final class QueryPacksCreateOrUpdateWithoutNameSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksCreateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksCreateNoName.json */ /** * Sample code: QueryPackCreateNoName. @@ -30,8 +30,8 @@ public static void queryPackCreateNoName(com.azure.resourcemanager.loganalytics. /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPackUpdateNoName.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPackUpdateNoName.json */ /** * Sample code: QueryPackUpdateNoName. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java index 71a8666537c5..1decd4ade04c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteSamples.java @@ -10,8 +10,8 @@ public final class QueryPacksDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksDelete.json */ /** * Sample code: QueryPacksDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java index bb2f520554f9..4b604de0c92c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class QueryPacksGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksGet.json */ /** * Sample code: QueryPackGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java index d6a9196b8adf..4c31805b962e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class QueryPacksListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksListByResourceGroup.json */ /** * Sample code: QueryPackListByResourceGroup. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java index cfbfa4347068..5355f9299ebd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListSamples.java @@ -10,8 +10,8 @@ public final class QueryPacksListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksList.json */ /** * Sample code: QueryPacksList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java index 5dd53593eed6..88b05a54b46e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksUpdateTagsSamples.java @@ -14,8 +14,8 @@ public final class QueryPacksUpdateTagsSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2019-09-01/examples/ - * QueryPacksUpdateTagsOnly.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/QueryPacksUpdateTagsOnly.json */ /** * Sample code: QueryPackUpdateTagsOnly. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java index d1eb2e1ebce7..7c2e0682ff07 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateSamples.java @@ -13,8 +13,8 @@ public final class SavedSearchesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSavedSearchesCreateOrUpdate.json */ /** * Sample code: SavedSearchCreateOrUpdate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java index cb0a0e4c8fd1..1d3b072e2c4e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteSamples.java @@ -10,8 +10,8 @@ public final class SavedSearchesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesDeleteSavedSearches.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDeleteSavedSearches.json */ /** * Sample code: SavedSearchesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java index dda1d9c87f7c..e07b43e10354 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetSamples.java @@ -10,8 +10,8 @@ public final class SavedSearchesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesSavedSearchesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSavedSearchesGet.json */ /** * Sample code: SavedSearchesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java index 7bf9bc3c73fb..2931575b93b6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class SavedSearchesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SavedSearchesListByWorkspace.json */ /** * Sample code: SavedSearchesList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java index 33fa55b4dd20..3fdd88e572db 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SchemaGetSamples.java @@ -10,8 +10,8 @@ public final class SchemaGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * SavedSearchesGetSchema.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SavedSearchesGetSchema.json */ /** * Sample code: WorkspacesGetSchema. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java index 68efb62c6ca4..abe0dae55397 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationGetSharedKeysSamples.java @@ -10,8 +10,8 @@ public final class SharedKeysOperationGetSharedKeysSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesGetSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGetSharedKeys.json */ /** * Sample code: SharedKeysList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java index 1739d55e2a41..80804317660d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SharedKeysOperationRegenerateSamples.java @@ -10,8 +10,8 @@ public final class SharedKeysOperationRegenerateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesRegenerateSharedKeys.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesRegenerateSharedKeys.json */ /** * Sample code: RegenerateSharedKeys. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java index a36413877d66..91fd24cca068 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsCreateOrUpdateSamples.java @@ -13,8 +13,8 @@ public final class StorageInsightConfigsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsCreateOrUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsCreateOrUpdate.json */ /** * Sample code: StorageInsightsCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java index fd6a760cda89..7a5f529dcfc3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteSamples.java @@ -10,8 +10,8 @@ public final class StorageInsightConfigsDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsDelete.json */ /** * Sample code: StorageInsightsDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java index 0f9fcc8b7936..58ba9630b883 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsGetSamples.java @@ -10,8 +10,8 @@ public final class StorageInsightConfigsGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsGet.json */ /** * Sample code: StorageInsightsGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java index b7b8e6125f33..ac06f1708f10 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class StorageInsightConfigsListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * StorageInsightsListByWorkspace.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/StorageInsightsListByWorkspace.json */ /** * Sample code: StorageInsightsList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationCreateOrUpdateSamples.java new file mode 100644 index 000000000000..540d72ef73fe --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationCreateOrUpdateSamples.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.RuleTypeEnum; +import java.time.OffsetDateTime; + +/** + * Samples for SummaryLogsOperation CreateOrUpdate. + */ +public final class SummaryLogsOperationCreateOrUpdateSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsUpsert.json + */ + /** + * Sample code: SummaryLogsUpsert. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsUpsert(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .define("summarylogs1") + .withExistingWorkspace("oiautorest6685", "oiautorest6685") + .withRuleType(RuleTypeEnum.USER) + .withRuleDefinition(new RuleDefinition().withQuery("MyTable_CL") + .withBinSize(180) + .withBinDelay(10) + .withBinStartTime(OffsetDateTime.parse("2020-02-03T04:05:06Z")) + .withDestinationTable("MyDestinationTable_CL")) + .create(); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationDeleteSamples.java new file mode 100644 index 000000000000..b6408d8f24ad --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationDeleteSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for SummaryLogsOperation Delete. + */ +public final class SummaryLogsOperationDeleteSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsDelete.json + */ + /** + * Sample code: SummaryLogsDelete. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsDelete(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .delete("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationGetSamples.java new file mode 100644 index 000000000000..0d582cfee879 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationGetSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for SummaryLogsOperation Get. + */ +public final class SummaryLogsOperationGetSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsGet.json + */ + /** + * Sample code: SummaryLogsGet. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsGet(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .getWithResponse("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationListByWorkspaceSamples.java new file mode 100644 index 000000000000..8d9b0affc88c --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationListByWorkspaceSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for SummaryLogsOperation ListByWorkspace. + */ +public final class SummaryLogsOperationListByWorkspaceSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsList.json + */ + /** + * Sample code: SummaryLogsListByWorkspace. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsListByWorkspace(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .listByWorkspace("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationRetryBinSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationRetryBinSamples.java new file mode 100644 index 000000000000..d85ecb3f400b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationRetryBinSamples.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBinProperties; +import java.time.OffsetDateTime; + +/** + * Samples for SummaryLogsOperation RetryBin. + */ +public final class SummaryLogsOperationRetryBinSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsRetryBin.json + */ + /** + * Sample code: SummaryLogsRetryBin. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsRetryBin(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .retryBin("oiautorest6685", "oiautorest6685", "summarylogs1", + new SummaryLogsRetryBin().withProperties(new SummaryLogsRetryBinProperties() + .withRetryBinStartTime(OffsetDateTime.parse("2020-02-03T04:00:00Z"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStartSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStartSamples.java new file mode 100644 index 000000000000..eda03e18fabc --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStartSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for SummaryLogsOperation Start. + */ +public final class SummaryLogsOperationStartSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsStart.json + */ + /** + * Sample code: SummaryLogsStart. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsStart(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .start("exampleresourcegroup", "exampleworkspace", "summarylogs3", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStopSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStopSamples.java new file mode 100644 index 000000000000..17f38ebd3033 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationStopSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for SummaryLogsOperation Stop. + */ +public final class SummaryLogsOperationStopSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/SummaryLogsStop.json + */ + /** + * Sample code: SummaryLogsStop. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void summaryLogsStop(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.summaryLogsOperations() + .stopWithResponse("oiautorest6685", "oiautorest6685", "summarylogs1", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java index 6afa7f1b9cfe..30c81cbb67d6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchSamples.java @@ -10,8 +10,8 @@ public final class TablesCancelSearchSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesSearchCancel.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesSearchCancel.json */ /** * Sample code: TablesSearchCancel. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java index 9a6bd6faddec..d7c87acef97f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateSamples.java @@ -15,8 +15,8 @@ public final class TablesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesUpsert.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesUpsert.json */ /** * Sample code: TablesUpsert. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java index b7172bcbfb3e..60b8aa3ff60c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteSamples.java @@ -10,8 +10,8 @@ public final class TablesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesDelete.json */ /** * Sample code: TablesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java index 05d356b11506..2d33860a4c20 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesGetSamples.java @@ -10,8 +10,8 @@ public final class TablesGetSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesGet.json */ /** * Sample code: TablesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java index 15fea02884c7..071274de8c87 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceSamples.java @@ -10,8 +10,8 @@ public final class TablesListByWorkspaceSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesList.json */ /** * Sample code: TablesListByWorkspace. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java index 8e0515e6611a..fb24107ad910 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateSamples.java @@ -10,8 +10,8 @@ public final class TablesMigrateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesMigrate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesMigrate.json */ /** * Sample code: TablesMigrate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java index ecb767fb0cee..55b3e1add3ab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/TablesUpdateSamples.java @@ -16,8 +16,8 @@ public final class TablesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * TablesUpsert.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/TablesUpsert.json */ /** * Sample code: TablesUpsert. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java index 1d4068a6ee85..5ab1c8899e83 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/UsagesListSamples.java @@ -10,8 +10,8 @@ public final class UsagesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesListUsages.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListUsages.json */ /** * Sample code: UsagesList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java index 69ff88bf84d6..28923a3085aa 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeGetPurgeStatusSamples.java @@ -10,8 +10,8 @@ public final class WorkspacePurgeGetPurgeStatusSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeOperation.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurgeOperation.json */ /** * Sample code: WorkspacePurgeOperation. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java index 1dd676c20ecb..9e7fa0a8e4d3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgePurgeSamples.java @@ -14,8 +14,8 @@ public final class WorkspacePurgePurgeSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurgeResourceId.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurgeResourceId.json */ /** * Sample code: WorkspacePurgeResourceId. @@ -34,8 +34,8 @@ public static void workspacePurgeResourceId(com.azure.resourcemanager.loganalyti /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/examples/ - * WorkspacesPurge.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesPurge.json */ /** * Sample code: WorkspacePurge. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java index abce117e89b4..d70ce13ef48d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateSamples.java @@ -15,8 +15,8 @@ public final class WorkspacesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesCreate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesCreate.json */ /** * Sample code: WorkspacesCreate. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java index dac400c21743..03b2a34a2113 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesDeleteSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesDelete.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesDelete.json */ /** * Sample code: WorkspacesDelete. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailbackSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailbackSamples.java new file mode 100644 index 000000000000..63a6e1af3357 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailbackSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for Workspaces Failback. + */ +public final class WorkspacesFailbackSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesFailback.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failback("oiautorest6685", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailoverSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailoverSamples.java new file mode 100644 index 000000000000..364b08df0dea --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesFailoverSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for Workspaces Failover. + */ +public final class WorkspacesFailoverSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesFailover.json + */ + /** + * Sample code: WorkspacesFailover. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void workspacesFailover(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().failover("oiautorest6685", "eastus", "oiautorest6685", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java index 845b2fba7be5..5cd903c4e779 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesGet.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesGet.json */ /** * Sample code: WorkspaceGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspSamples.java new file mode 100644 index 000000000000..3fc7ad9c9b00 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspSamples.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for Workspaces GetNsp. + */ +public final class WorkspacesGetNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_Get.json + */ + /** + * Sample code: Get NSP config by name for Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + getNSPConfigByNameForScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .getNspWithResponse("exampleRG", "someWorkspace", "somePerimeterConfiguration", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java index 165d1c4d6af1..d16ea5977e33 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesListByResourceGroupSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesListByResourceGroup.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesListByResourceGroup.json */ /** * Sample code: WorkspacesGet. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspSamples.java new file mode 100644 index 000000000000..296676ebf5d6 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspSamples.java @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for Workspaces ListNsp. + */ +public final class WorkspacesListNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_List.json + */ + /** + * Sample code: List NSP configs by Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + listNSPConfigsByScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces().listNsp("exampleRG", "someWorkspace", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java index 535445f0da1b..ebbbd4be541e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListSamples.java @@ -10,8 +10,8 @@ public final class WorkspacesListSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesSubscriptionList.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesSubscriptionList.json */ /** * Sample code: WorkspacesSubscriptionList. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesReconcileNspSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesReconcileNspSamples.java new file mode 100644 index 000000000000..066789b7ff8f --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesReconcileNspSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +/** + * Samples for Workspaces ReconcileNsp. + */ +public final class WorkspacesReconcileNspSamples { + /* + * x-ms-original-file: + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/NSPForWorkspaces_Reconcile.json + */ + /** + * Sample code: Reconcile NSP config for Scheduled Query Rule. + * + * @param manager Entry point to LogAnalyticsManager. + */ + public static void + reconcileNSPConfigForScheduledQueryRule(com.azure.resourcemanager.loganalytics.LogAnalyticsManager manager) { + manager.workspaces() + .reconcileNsp("exampleRG", "someWorkspace", "somePerimeterConfiguration", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java index 9d1fef46d1c6..c41aee9f55da 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/samples/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesUpdateSamples.java @@ -15,8 +15,8 @@ public final class WorkspacesUpdateSamples { /* * x-ms-original-file: - * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2022-10-01/examples/ - * WorkspacesUpdate.json + * specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/OperationalInsights/stable/2025- + * 07-01/examples/WorkspacesUpdate.json */ /** * Sample code: WorkspacesPatch. diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesSubscriptionsItemTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesSubscriptionsItemTests.java new file mode 100644 index 000000000000..af4fbaa556d3 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesSubscriptionsItemTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import org.junit.jupiter.api.Assertions; + +public final class AccessRulePropertiesSubscriptionsItemTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessRulePropertiesSubscriptionsItem model = BinaryData.fromString("{\"id\":\"mzdlyjdfqwmkyo\"}") + .toObject(AccessRulePropertiesSubscriptionsItem.class); + Assertions.assertEquals("mzdlyjdfqwmkyo", model.id()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AccessRulePropertiesSubscriptionsItem model + = new AccessRulePropertiesSubscriptionsItem().withId("mzdlyjdfqwmkyo"); + model = BinaryData.fromObject(model).toObject(AccessRulePropertiesSubscriptionsItem.class); + Assertions.assertEquals("mzdlyjdfqwmkyo", model.id()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesTests.java new file mode 100644 index 000000000000..7a5c3b15c1a5 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRulePropertiesTests.java @@ -0,0 +1,67 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class AccessRulePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessRuleProperties model = BinaryData.fromString( + "{\"direction\":\"Outbound\",\"addressPrefixes\":[\"ywuhpsvfuur\",\"tlwexxwlalniexz\",\"rzpgep\"],\"subscriptions\":[{\"id\":\"bwwpgdakchzy\"}],\"networkSecurityPerimeters\":[{\"id\":\"q\",\"perimeterGuid\":\"fcdf021f-cddf-4ed2-9e35-35a95af5df26\",\"location\":\"cxkjibnxmysuxswq\"},{\"id\":\"tvlwijpsttexoq\",\"perimeterGuid\":\"8237a725-6bb9-4eb9-986a-ba9c33d7a075\",\"location\":\"cyyufmh\"},{\"id\":\"nc\",\"perimeterGuid\":\"4afd3e24-43f2-4eb4-95b1-9cda16e7448c\",\"location\":\"qspkcdqzhlctd\"},{\"id\":\"nqndyfpchrqbn\",\"perimeterGuid\":\"c5688b78-39bc-4c74-bbff-74cd364f3c29\",\"location\":\"cgegydcwbo\"}],\"fullyQualifiedDomainNames\":[\"mvqqolih\"],\"emailAddresses\":[\"iouaubrjt\",\"oq\",\"fuojrngif\"],\"phoneNumbers\":[\"pasccbi\"]}") + .toObject(AccessRuleProperties.class); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.direction()); + Assertions.assertEquals("ywuhpsvfuur", model.addressPrefixes().get(0)); + Assertions.assertEquals("bwwpgdakchzy", model.subscriptions().get(0).id()); + Assertions.assertEquals("q", model.networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("fcdf021f-cddf-4ed2-9e35-35a95af5df26"), + model.networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("cxkjibnxmysuxswq", model.networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("mvqqolih", model.fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("iouaubrjt", model.emailAddresses().get(0)); + Assertions.assertEquals("pasccbi", model.phoneNumbers().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AccessRuleProperties model = new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("ywuhpsvfuur", "tlwexxwlalniexz", "rzpgep")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem().withId("bwwpgdakchzy"))) + .withNetworkSecurityPerimeters(Arrays.asList( + new NetworkSecurityPerimeter().withId("q") + .withPerimeterGuid(UUID.fromString("fcdf021f-cddf-4ed2-9e35-35a95af5df26")) + .withLocation("cxkjibnxmysuxswq"), + new NetworkSecurityPerimeter().withId("tvlwijpsttexoq") + .withPerimeterGuid(UUID.fromString("8237a725-6bb9-4eb9-986a-ba9c33d7a075")) + .withLocation("cyyufmh"), + new NetworkSecurityPerimeter().withId("nc") + .withPerimeterGuid(UUID.fromString("4afd3e24-43f2-4eb4-95b1-9cda16e7448c")) + .withLocation("qspkcdqzhlctd"), + new NetworkSecurityPerimeter().withId("nqndyfpchrqbn") + .withPerimeterGuid(UUID.fromString("c5688b78-39bc-4c74-bbff-74cd364f3c29")) + .withLocation("cgegydcwbo"))) + .withFullyQualifiedDomainNames(Arrays.asList("mvqqolih")) + .withEmailAddresses(Arrays.asList("iouaubrjt", "oq", "fuojrngif")) + .withPhoneNumbers(Arrays.asList("pasccbi")); + model = BinaryData.fromObject(model).toObject(AccessRuleProperties.class); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.direction()); + Assertions.assertEquals("ywuhpsvfuur", model.addressPrefixes().get(0)); + Assertions.assertEquals("bwwpgdakchzy", model.subscriptions().get(0).id()); + Assertions.assertEquals("q", model.networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("fcdf021f-cddf-4ed2-9e35-35a95af5df26"), + model.networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("cxkjibnxmysuxswq", model.networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("mvqqolih", model.fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("iouaubrjt", model.emailAddresses().get(0)); + Assertions.assertEquals("pasccbi", model.phoneNumbers().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRuleTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRuleTests.java new file mode 100644 index 000000000000..7627bb861e93 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AccessRuleTests.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class AccessRuleTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AccessRule model = BinaryData.fromString( + "{\"name\":\"yrxpdlcgqls\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"rddga\",\"quhiosrsjuivf\",\"disyirnxz\",\"czexrxzbujrtrhqv\"],\"subscriptions\":[{\"id\":\"khgn\"}],\"networkSecurityPerimeters\":[{\"id\":\"nzlrpiqywncvjt\",\"perimeterGuid\":\"bbdc99ed-04bf-44a9-bcce-e0e5e32f2675\",\"location\":\"ofizehtdhgbj\"},{\"id\":\"reljeamur\",\"perimeterGuid\":\"35ed2012-51db-4e82-9308-ff8bd4f8b868\",\"location\":\"lovuana\"},{\"id\":\"cxlpmjerb\",\"perimeterGuid\":\"8a369177-ebd3-4583-b465-eafb572e3f34\",\"location\":\"lvidizozs\"},{\"id\":\"ccxjm\",\"perimeterGuid\":\"6b1215e4-8788-4ec0-9135-19bbe112ee85\",\"location\":\"dgnwncypuuwwlt\"}],\"fullyQualifiedDomainNames\":[\"jctzenkei\",\"zzhmkd\",\"svflyhbxcudch\"],\"emailAddresses\":[\"rb\",\"ldforobwj\",\"vizbfhfo\"],\"phoneNumbers\":[\"cqpbtuo\",\"xesz\",\"bbelawumuaslzk\",\"rrwoycqucwyhahn\"]}}") + .toObject(AccessRule.class); + Assertions.assertEquals("yrxpdlcgqls", model.name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.properties().direction()); + Assertions.assertEquals("rddga", model.properties().addressPrefixes().get(0)); + Assertions.assertEquals("khgn", model.properties().subscriptions().get(0).id()); + Assertions.assertEquals("nzlrpiqywncvjt", model.properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("bbdc99ed-04bf-44a9-bcce-e0e5e32f2675"), + model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("ofizehtdhgbj", model.properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("jctzenkei", model.properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("rb", model.properties().emailAddresses().get(0)); + Assertions.assertEquals("cqpbtuo", model.properties().phoneNumbers().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AccessRule model = new AccessRule().withName("yrxpdlcgqls") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("rddga", "quhiosrsjuivf", "disyirnxz", "czexrxzbujrtrhqv")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem().withId("khgn"))) + .withNetworkSecurityPerimeters(Arrays.asList( + new NetworkSecurityPerimeter().withId("nzlrpiqywncvjt") + .withPerimeterGuid(UUID.fromString("bbdc99ed-04bf-44a9-bcce-e0e5e32f2675")) + .withLocation("ofizehtdhgbj"), + new NetworkSecurityPerimeter().withId("reljeamur") + .withPerimeterGuid(UUID.fromString("35ed2012-51db-4e82-9308-ff8bd4f8b868")) + .withLocation("lovuana"), + new NetworkSecurityPerimeter().withId("cxlpmjerb") + .withPerimeterGuid(UUID.fromString("8a369177-ebd3-4583-b465-eafb572e3f34")) + .withLocation("lvidizozs"), + new NetworkSecurityPerimeter().withId("ccxjm") + .withPerimeterGuid(UUID.fromString("6b1215e4-8788-4ec0-9135-19bbe112ee85")) + .withLocation("dgnwncypuuwwlt"))) + .withFullyQualifiedDomainNames(Arrays.asList("jctzenkei", "zzhmkd", "svflyhbxcudch")) + .withEmailAddresses(Arrays.asList("rb", "ldforobwj", "vizbfhfo")) + .withPhoneNumbers(Arrays.asList("cqpbtuo", "xesz", "bbelawumuaslzk", "rrwoycqucwyhahn"))); + model = BinaryData.fromObject(model).toObject(AccessRule.class); + Assertions.assertEquals("yrxpdlcgqls", model.name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, model.properties().direction()); + Assertions.assertEquals("rddga", model.properties().addressPrefixes().get(0)); + Assertions.assertEquals("khgn", model.properties().subscriptions().get(0).id()); + Assertions.assertEquals("nzlrpiqywncvjt", model.properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("bbdc99ed-04bf-44a9-bcce-e0e5e32f2675"), + model.properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("ofizehtdhgbj", model.properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("jctzenkei", model.properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("rb", model.properties().emailAddresses().get(0)); + Assertions.assertEquals("cqpbtuo", model.properties().phoneNumbers().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java index 2a0ff4de6028..6ef22fcc5837 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AssociatedWorkspaceTests.java @@ -11,7 +11,7 @@ public final class AssociatedWorkspaceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AssociatedWorkspace model = BinaryData.fromString( - "{\"workspaceId\":\"pagao\",\"workspaceName\":\"ulpqblylsyxkqjn\",\"resourceId\":\"ervtiagxs\",\"associateDate\":\"zuempsbzkf\"}") + "{\"workspaceId\":\"d4467277-9932-4ff4-9713-ca5858c7d9fc\",\"workspaceName\":\"cqhsm\",\"resourceId\":\"rkdtmlxh\",\"associateDate\":\"2021-09-14T21:41:32Z\"}") .toObject(AssociatedWorkspace.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java index 13f701c200bb..75085a254fff 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTierInnerTests.java @@ -11,7 +11,7 @@ public final class AvailableServiceTierInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { AvailableServiceTierInner model = BinaryData.fromString( - "{\"serviceTier\":\"Premium\",\"enabled\":true,\"minimumRetention\":2447311563304363726,\"maximumRetention\":2614637191948743156,\"defaultRetention\":5459563894986340273,\"capacityReservationLevel\":7110930774958137161,\"lastSkuUpdate\":\"piexpbtgiw\"}") + "{\"serviceTier\":\"Standalone\",\"enabled\":true,\"minimumRetention\":1510156696946077578,\"maximumRetention\":4193584240156362355,\"defaultRetention\":6508308958074251403,\"capacityReservationLevel\":550039120288444364,\"lastSkuUpdate\":\"mtz\"}") .toObject(AvailableServiceTierInner.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java index 11fb44320e42..a99343810768 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AvailableServiceTiersListByWorkspaceWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.AvailableServiceTier; @@ -21,17 +21,17 @@ public final class AvailableServiceTiersListByWorkspaceWithResponseMockTests { @Test public void testListByWorkspaceWithResponse() throws Exception { String responseStr - = "[{\"serviceTier\":\"CapacityReservation\",\"enabled\":true,\"minimumRetention\":3767644182859901371,\"maximumRetention\":7248546755237746462,\"defaultRetention\":840422895247134750,\"capacityReservationLevel\":8295020029995054755,\"lastSkuUpdate\":\"ujr\"},{\"serviceTier\":\"PerGB2018\",\"enabled\":false,\"minimumRetention\":120736086062160717,\"maximumRetention\":2641992673329436235,\"defaultRetention\":3461505183507942780,\"capacityReservationLevel\":854242813011904996,\"lastSkuUpdate\":\"ikzoeovvtzejetj\"},{\"serviceTier\":\"Free\",\"enabled\":false,\"minimumRetention\":7781117605646169012,\"maximumRetention\":159668866868514414,\"defaultRetention\":7370744360813533838,\"capacityReservationLevel\":700409671675457936,\"lastSkuUpdate\":\"rzvh\"}]"; + = "[{\"serviceTier\":\"CapacityReservation\",\"enabled\":false,\"minimumRetention\":1432087697888177845,\"maximumRetention\":8313394416637011338,\"defaultRetention\":5559566767637280772,\"capacityReservationLevel\":6950782705334382897,\"lastSkuUpdate\":\"jg\"},{\"serviceTier\":\"Premium\",\"enabled\":true,\"minimumRetention\":5983360915282781316,\"maximumRetention\":4653983891463635460,\"defaultRetention\":3143366093760834812,\"capacityReservationLevel\":4708968390247773451,\"lastSkuUpdate\":\"ltxijjumfqwazln\"},{\"serviceTier\":\"PerGB2018\",\"enabled\":false,\"minimumRetention\":3523690994753868801,\"maximumRetention\":3035438207417975715,\"defaultRetention\":1193446146950584030,\"capacityReservationLevel\":6287732006458517592,\"lastSkuUpdate\":\"yfu\"},{\"serviceTier\":\"Standalone\",\"enabled\":true,\"minimumRetention\":3265340554220962405,\"maximumRetention\":1400392420008149330,\"defaultRetention\":2431415951490180842,\"capacityReservationLevel\":3788300585704298114,\"lastSkuUpdate\":\"hm\"}]"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); List response = manager.availableServiceTiers() - .listByWorkspaceWithResponse("ztlvtmvagbwidqlv", "ukoveofi", com.azure.core.util.Context.NONE) + .listByWorkspaceWithResponse("qtferrqwexjkmf", "apjwogqqnobpudcd", com.azure.core.util.Context.NONE) .getValue(); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java index aec477e4178d..5755d7c4687c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureEntityResourceTests.java @@ -10,9 +10,9 @@ public final class AzureEntityResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - AzureEntityResource model = BinaryData - .fromString("{\"etag\":\"slbi\",\"id\":\"kojgcyzts\",\"name\":\"mznbaeqphch\",\"type\":\"nrnrp\"}") - .toObject(AzureEntityResource.class); + AzureEntityResource model + = BinaryData.fromString("{\"etag\":\"whcjyxcc\",\"id\":\"bvpa\",\"name\":\"akkud\",\"type\":\"px\"}") + .toObject(AzureEntityResource.class); } @org.junit.jupiter.api.Test diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureResourcePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureResourcePropertiesTests.java deleted file mode 100644 index d2daa1af46c4..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/AzureResourcePropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.AzureResourceProperties; - -public final class AzureResourcePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - AzureResourceProperties model - = BinaryData.fromString("{\"id\":\"sxlzevgbmqj\",\"name\":\"bcypmi\",\"type\":\"w\"}") - .toObject(AzureResourceProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - AzureResourceProperties model = new AzureResourceProperties(); - model = BinaryData.fromObject(model).toObject(AzureResourceProperties.class); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java index a404402661f5..18652f10597f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CapacityReservationPropertiesTests.java @@ -11,7 +11,7 @@ public final class CapacityReservationPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CapacityReservationProperties model - = BinaryData.fromString("{\"lastSkuUpdate\":\"eyvpnqicvinvkj\",\"minCapacity\":2624293456615314766}") + = BinaryData.fromString("{\"lastSkuUpdate\":\"2021-01-05T18:43:06Z\",\"minCapacity\":8378841457136361246}") .toObject(CapacityReservationProperties.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterReplicationPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterReplicationPropertiesTests.java new file mode 100644 index 000000000000..ea1c0aeecb42 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterReplicationPropertiesTests.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.ClusterReplicationProperties; +import org.junit.jupiter.api.Assertions; + +public final class ClusterReplicationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ClusterReplicationProperties model = BinaryData.fromString( + "{\"location\":\"kc\",\"enabled\":false,\"isAvailabilityZonesEnabled\":true,\"provisioningState\":\"Enabling\",\"createdDate\":\"2021-03-12T09:05:14Z\",\"lastModifiedDate\":\"2021-11-03T04:50:08Z\"}") + .toObject(ClusterReplicationProperties.class); + Assertions.assertEquals("kc", model.location()); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.isAvailabilityZonesEnabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ClusterReplicationProperties model = new ClusterReplicationProperties().withLocation("kc") + .withEnabled(false) + .withIsAvailabilityZonesEnabled(true); + model = BinaryData.fromObject(model).toObject(ClusterReplicationProperties.class); + Assertions.assertEquals("kc", model.location()); + Assertions.assertFalse(model.enabled()); + Assertions.assertTrue(model.isAvailabilityZonesEnabled()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java index 9a2be34cbd19..ec54834d00ab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClusterSkuTests.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.Capacity; import com.azure.resourcemanager.loganalytics.models.ClusterSku; import com.azure.resourcemanager.loganalytics.models.ClusterSkuNameEnum; import org.junit.jupiter.api.Assertions; @@ -13,18 +12,18 @@ public final class ClusterSkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - ClusterSku model - = BinaryData.fromString("{\"capacity\":2000,\"name\":\"CapacityReservation\"}").toObject(ClusterSku.class); - Assertions.assertEquals(Capacity.TWO_ZERO_ZERO_ZERO, model.capacity()); + ClusterSku model = BinaryData.fromString("{\"capacity\":4121879659269768466,\"name\":\"CapacityReservation\"}") + .toObject(ClusterSku.class); + Assertions.assertEquals(4121879659269768466L, model.capacity()); Assertions.assertEquals(ClusterSkuNameEnum.CAPACITY_RESERVATION, model.name()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ClusterSku model = new ClusterSku().withCapacity(Capacity.TWO_ZERO_ZERO_ZERO) - .withName(ClusterSkuNameEnum.CAPACITY_RESERVATION); + ClusterSku model + = new ClusterSku().withCapacity(4121879659269768466L).withName(ClusterSkuNameEnum.CAPACITY_RESERVATION); model = BinaryData.fromObject(model).toObject(ClusterSku.class); - Assertions.assertEquals(Capacity.TWO_ZERO_ZERO_ZERO, model.capacity()); + Assertions.assertEquals(4121879659269768466L, model.capacity()); Assertions.assertEquals(ClusterSkuNameEnum.CAPACITY_RESERVATION, model.name()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java index 57864c8d9600..ab6b2cc44564 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ClustersDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.clusters().delete("rnfxtgddp", "th", com.azure.core.util.Context.NONE); + manager.clusters().delete("aglkafhon", "juj", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java index e3f8126a79ec..fb56750955dd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ColumnTests.java @@ -14,27 +14,27 @@ public final class ColumnTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Column model = BinaryData.fromString( - "{\"name\":\"q\",\"type\":\"dateTime\",\"dataTypeHint\":\"guid\",\"displayName\":\"jb\",\"description\":\"gaehvvibrxjjst\",\"isDefaultDisplay\":false,\"isHidden\":false}") + "{\"name\":\"pikpz\",\"type\":\"real\",\"dataTypeHint\":\"uri\",\"displayName\":\"nlfzxiavrmbz\",\"description\":\"okixrjqcir\",\"isDefaultDisplay\":false,\"isHidden\":true}") .toObject(Column.class); - Assertions.assertEquals("q", model.name()); - Assertions.assertEquals(ColumnTypeEnum.DATE_TIME, model.type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.dataTypeHint()); - Assertions.assertEquals("jb", model.displayName()); - Assertions.assertEquals("gaehvvibrxjjst", model.description()); + Assertions.assertEquals("pikpz", model.name()); + Assertions.assertEquals(ColumnTypeEnum.REAL, model.type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.URI, model.dataTypeHint()); + Assertions.assertEquals("nlfzxiavrmbz", model.displayName()); + Assertions.assertEquals("okixrjqcir", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Column model = new Column().withName("q") - .withType(ColumnTypeEnum.DATE_TIME) - .withDataTypeHint(ColumnDataTypeHintEnum.GUID) - .withDisplayName("jb") - .withDescription("gaehvvibrxjjst"); + Column model = new Column().withName("pikpz") + .withType(ColumnTypeEnum.REAL) + .withDataTypeHint(ColumnDataTypeHintEnum.URI) + .withDisplayName("nlfzxiavrmbz") + .withDescription("okixrjqcir"); model = BinaryData.fromObject(model).toObject(Column.class); - Assertions.assertEquals("q", model.name()); - Assertions.assertEquals(ColumnTypeEnum.DATE_TIME, model.type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.dataTypeHint()); - Assertions.assertEquals("jb", model.displayName()); - Assertions.assertEquals("gaehvvibrxjjst", model.description()); + Assertions.assertEquals("pikpz", model.name()); + Assertions.assertEquals(ColumnTypeEnum.REAL, model.type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.URI, model.dataTypeHint()); + Assertions.assertEquals("nlfzxiavrmbz", model.displayName()); + Assertions.assertEquals("okixrjqcir", model.description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java index 7ac059f116db..2bb6c7f6df27 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/CoreSummaryTests.java @@ -12,18 +12,17 @@ public final class CoreSummaryTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CoreSummary model - = BinaryData.fromString("{\"status\":\"elpcirelsfeaenwa\",\"numberOfDocuments\":6225068900260031070}") + = BinaryData.fromString("{\"status\":\"zvqtmnubexkp\",\"numberOfDocuments\":6799001413428276597}") .toObject(CoreSummary.class); - Assertions.assertEquals("elpcirelsfeaenwa", model.status()); - Assertions.assertEquals(6225068900260031070L, model.numberOfDocuments()); + Assertions.assertEquals("zvqtmnubexkp", model.status()); + Assertions.assertEquals(6799001413428276597L, model.numberOfDocuments()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - CoreSummary model - = new CoreSummary().withStatus("elpcirelsfeaenwa").withNumberOfDocuments(6225068900260031070L); + CoreSummary model = new CoreSummary().withStatus("zvqtmnubexkp").withNumberOfDocuments(6799001413428276597L); model = BinaryData.fromObject(model).toObject(CoreSummary.class); - Assertions.assertEquals("elpcirelsfeaenwa", model.status()); - Assertions.assertEquals(6225068900260031070L, model.numberOfDocuments()); + Assertions.assertEquals("zvqtmnubexkp", model.status()); + Assertions.assertEquals(6799001413428276597L, model.numberOfDocuments()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java index 77d446726320..62a324915bf1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportInnerTests.java @@ -13,33 +13,33 @@ public final class DataExportInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataExportInner model = BinaryData.fromString( - "{\"properties\":{\"dataExportId\":\"ovm\",\"tableNames\":[\"kacspkw\",\"hzdobpxjmflbvvnc\"],\"destination\":{\"resourceId\":\"kcciwwzjuqkhr\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"ku\"}},\"enable\":false,\"createdDate\":\"kg\",\"lastModifiedDate\":\"auu\"},\"id\":\"mjmvxieduugidyjr\",\"name\":\"f\",\"type\":\"y\"}") + "{\"properties\":{\"dataExportId\":\"qeof\",\"tableNames\":[\"e\",\"jhqjbasvmsmjqul\",\"gsntnbybkzgcwr\",\"clxxwrljdo\"],\"destination\":{\"resourceId\":\"kcqvkocrc\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"nh\"}},\"enable\":true,\"createdDate\":\"biksq\",\"lastModifiedDate\":\"lssai\"},\"id\":\"qpjwnzlljfm\",\"name\":\"pee\",\"type\":\"vmgxsab\"}") .toObject(DataExportInner.class); - Assertions.assertEquals("ovm", model.dataExportId()); - Assertions.assertEquals("kacspkw", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("kg", model.createdDate()); - Assertions.assertEquals("auu", model.lastModifiedDate()); - Assertions.assertEquals("kcciwwzjuqkhr", model.resourceId()); - Assertions.assertEquals("ku", model.eventHubName()); + Assertions.assertEquals("qeof", model.dataExportId()); + Assertions.assertEquals("e", model.tableNames().get(0)); + Assertions.assertTrue(model.enable()); + Assertions.assertEquals("biksq", model.createdDate()); + Assertions.assertEquals("lssai", model.lastModifiedDate()); + Assertions.assertEquals("kcqvkocrc", model.resourceId()); + Assertions.assertEquals("nh", model.eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataExportInner model = new DataExportInner().withDataExportId("ovm") - .withTableNames(Arrays.asList("kacspkw", "hzdobpxjmflbvvnc")) - .withEnable(false) - .withCreatedDate("kg") - .withLastModifiedDate("auu") - .withResourceId("kcciwwzjuqkhr") - .withEventHubName("ku"); + DataExportInner model = new DataExportInner().withDataExportId("qeof") + .withTableNames(Arrays.asList("e", "jhqjbasvmsmjqul", "gsntnbybkzgcwr", "clxxwrljdo")) + .withEnable(true) + .withCreatedDate("biksq") + .withLastModifiedDate("lssai") + .withResourceId("kcqvkocrc") + .withEventHubName("nh"); model = BinaryData.fromObject(model).toObject(DataExportInner.class); - Assertions.assertEquals("ovm", model.dataExportId()); - Assertions.assertEquals("kacspkw", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("kg", model.createdDate()); - Assertions.assertEquals("auu", model.lastModifiedDate()); - Assertions.assertEquals("kcciwwzjuqkhr", model.resourceId()); - Assertions.assertEquals("ku", model.eventHubName()); + Assertions.assertEquals("qeof", model.dataExportId()); + Assertions.assertEquals("e", model.tableNames().get(0)); + Assertions.assertTrue(model.enable()); + Assertions.assertEquals("biksq", model.createdDate()); + Assertions.assertEquals("lssai", model.lastModifiedDate()); + Assertions.assertEquals("kcqvkocrc", model.resourceId()); + Assertions.assertEquals("nh", model.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java index 011824c5d840..42883713205f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportListResultTests.java @@ -14,41 +14,55 @@ public final class DataExportListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataExportListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"dataExportId\":\"exfwhy\",\"tableNames\":[\"i\",\"vyvdcs\",\"tynnaamdectehfi\",\"scjeypv\"],\"destination\":{\"resourceId\":\"zrkgqhcjrefovg\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"eyyvxyqjpkcat\"}},\"enable\":false,\"createdDate\":\"jcrcczsqpjhvmda\",\"lastModifiedDate\":\"nysounqe\"},\"id\":\"a\",\"name\":\"oaeupfhyhltrpmo\",\"type\":\"jmcmatuokthfu\"},{\"properties\":{\"dataExportId\":\"odsfcpkvxodpuozm\",\"tableNames\":[\"ydagfuaxbe\",\"yiuokktwh\",\"dxwzywqsmbsurexi\",\"o\"],\"destination\":{\"resourceId\":\"ocfs\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"ddystkiiuxhqy\"}},\"enable\":false,\"createdDate\":\"rrqnbpoczvyifqrv\",\"lastModifiedDate\":\"vjsllrmvvdfw\"},\"id\":\"t\",\"name\":\"pnpulexxbczwtru\",\"type\":\"iqzbq\"}]}") + "{\"value\":[{\"properties\":{\"dataExportId\":\"tihfx\",\"tableNames\":[\"jbpzvgnwzsymg\",\"zufcyzkohdbi\",\"anufhfcbjysag\",\"th\"],\"destination\":{\"resourceId\":\"hab\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"xwczbyscnp\"}},\"enable\":true,\"createdDate\":\"ivyqniwbybrkxvd\",\"lastModifiedDate\":\"jgrtfwvukxga\"},\"id\":\"dcc\",\"name\":\"nhsjcnyej\",\"type\":\"kryhtnapczwlokj\"},{\"properties\":{\"dataExportId\":\"kkvnipjox\",\"tableNames\":[\"nchgej\",\"podmailzydehojwy\"],\"destination\":{\"resourceId\":\"uxinpmqnjaq\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"prozvcputegjvwmf\"}},\"enable\":false,\"createdDate\":\"cmdv\",\"lastModifiedDate\":\"hulsuuvmkjozkrwf\"},\"id\":\"dio\",\"name\":\"jpslwejd\",\"type\":\"vwryoqpso\"},{\"properties\":{\"dataExportId\":\"tazak\",\"tableNames\":[\"lahbcryff\"],\"destination\":{\"resourceId\":\"dosyg\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"jakhmsbzjh\"}},\"enable\":false,\"createdDate\":\"vdphlxaolthqtr\",\"lastModifiedDate\":\"jbp\"},\"id\":\"zfsinzgvf\",\"name\":\"jrwzox\",\"type\":\"j\"},{\"properties\":{\"dataExportId\":\"lluwfzitonpeq\",\"tableNames\":[\"jkjlxofpdvhpfx\",\"ypininm\",\"yhuybbkpod\"],\"destination\":{\"resourceId\":\"ooginuvamih\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"rxzxtheo\"}},\"enable\":false,\"createdDate\":\"vyevcciqi\",\"lastModifiedDate\":\"hungbwjzrnf\"},\"id\":\"gxg\",\"name\":\"spemvtzfk\",\"type\":\"fublj\"}]}") .toObject(DataExportListResult.class); - Assertions.assertEquals("exfwhy", model.value().get(0).dataExportId()); - Assertions.assertEquals("i", model.value().get(0).tableNames().get(0)); - Assertions.assertEquals(false, model.value().get(0).enable()); - Assertions.assertEquals("jcrcczsqpjhvmda", model.value().get(0).createdDate()); - Assertions.assertEquals("nysounqe", model.value().get(0).lastModifiedDate()); - Assertions.assertEquals("zrkgqhcjrefovg", model.value().get(0).resourceId()); - Assertions.assertEquals("eyyvxyqjpkcat", model.value().get(0).eventHubName()); + Assertions.assertEquals("tihfx", model.value().get(0).dataExportId()); + Assertions.assertEquals("jbpzvgnwzsymg", model.value().get(0).tableNames().get(0)); + Assertions.assertTrue(model.value().get(0).enable()); + Assertions.assertEquals("ivyqniwbybrkxvd", model.value().get(0).createdDate()); + Assertions.assertEquals("jgrtfwvukxga", model.value().get(0).lastModifiedDate()); + Assertions.assertEquals("hab", model.value().get(0).resourceId()); + Assertions.assertEquals("xwczbyscnp", model.value().get(0).eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { DataExportListResult model = new DataExportListResult().withValue(Arrays.asList( - new DataExportInner().withDataExportId("exfwhy") - .withTableNames(Arrays.asList("i", "vyvdcs", "tynnaamdectehfi", "scjeypv")) + new DataExportInner().withDataExportId("tihfx") + .withTableNames(Arrays.asList("jbpzvgnwzsymg", "zufcyzkohdbi", "anufhfcbjysag", "th")) + .withEnable(true) + .withCreatedDate("ivyqniwbybrkxvd") + .withLastModifiedDate("jgrtfwvukxga") + .withResourceId("hab") + .withEventHubName("xwczbyscnp"), + new DataExportInner().withDataExportId("kkvnipjox") + .withTableNames(Arrays.asList("nchgej", "podmailzydehojwy")) .withEnable(false) - .withCreatedDate("jcrcczsqpjhvmda") - .withLastModifiedDate("nysounqe") - .withResourceId("zrkgqhcjrefovg") - .withEventHubName("eyyvxyqjpkcat"), - new DataExportInner().withDataExportId("odsfcpkvxodpuozm") - .withTableNames(Arrays.asList("ydagfuaxbe", "yiuokktwh", "dxwzywqsmbsurexi", "o")) + .withCreatedDate("cmdv") + .withLastModifiedDate("hulsuuvmkjozkrwf") + .withResourceId("uxinpmqnjaq") + .withEventHubName("prozvcputegjvwmf"), + new DataExportInner().withDataExportId("tazak") + .withTableNames(Arrays.asList("lahbcryff")) .withEnable(false) - .withCreatedDate("rrqnbpoczvyifqrv") - .withLastModifiedDate("vjsllrmvvdfw") - .withResourceId("ocfs") - .withEventHubName("ddystkiiuxhqy"))); + .withCreatedDate("vdphlxaolthqtr") + .withLastModifiedDate("jbp") + .withResourceId("dosyg") + .withEventHubName("jakhmsbzjh"), + new DataExportInner().withDataExportId("lluwfzitonpeq") + .withTableNames(Arrays.asList("jkjlxofpdvhpfx", "ypininm", "yhuybbkpod")) + .withEnable(false) + .withCreatedDate("vyevcciqi") + .withLastModifiedDate("hungbwjzrnf") + .withResourceId("ooginuvamih") + .withEventHubName("rxzxtheo"))); model = BinaryData.fromObject(model).toObject(DataExportListResult.class); - Assertions.assertEquals("exfwhy", model.value().get(0).dataExportId()); - Assertions.assertEquals("i", model.value().get(0).tableNames().get(0)); - Assertions.assertEquals(false, model.value().get(0).enable()); - Assertions.assertEquals("jcrcczsqpjhvmda", model.value().get(0).createdDate()); - Assertions.assertEquals("nysounqe", model.value().get(0).lastModifiedDate()); - Assertions.assertEquals("zrkgqhcjrefovg", model.value().get(0).resourceId()); - Assertions.assertEquals("eyyvxyqjpkcat", model.value().get(0).eventHubName()); + Assertions.assertEquals("tihfx", model.value().get(0).dataExportId()); + Assertions.assertEquals("jbpzvgnwzsymg", model.value().get(0).tableNames().get(0)); + Assertions.assertTrue(model.value().get(0).enable()); + Assertions.assertEquals("ivyqniwbybrkxvd", model.value().get(0).createdDate()); + Assertions.assertEquals("jgrtfwvukxga", model.value().get(0).lastModifiedDate()); + Assertions.assertEquals("hab", model.value().get(0).resourceId()); + Assertions.assertEquals("xwczbyscnp", model.value().get(0).eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java index 02615cd49ba4..d06950c1fe67 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportPropertiesTests.java @@ -13,33 +13,33 @@ public final class DataExportPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataExportProperties model = BinaryData.fromString( - "{\"dataExportId\":\"svexcsonpclhoco\",\"tableNames\":[\"lkevle\",\"gz\"],\"destination\":{\"resourceId\":\"u\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"axkffei\"}},\"enable\":false,\"createdDate\":\"vmezy\",\"lastModifiedDate\":\"hxmzsbbzoggig\"}") + "{\"dataExportId\":\"qduujitcjczdz\",\"tableNames\":[\"ndhkrw\",\"d\",\"ppdsbdkvwrwj\"],\"destination\":{\"resourceId\":\"usnhutje\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"dhugjzzdatqxhocd\"}},\"enable\":true,\"createdDate\":\"lgphu\",\"lastModifiedDate\":\"cndvkaozwyiftyhx\"}") .toObject(DataExportProperties.class); - Assertions.assertEquals("svexcsonpclhoco", model.dataExportId()); - Assertions.assertEquals("lkevle", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("vmezy", model.createdDate()); - Assertions.assertEquals("hxmzsbbzoggig", model.lastModifiedDate()); - Assertions.assertEquals("u", model.resourceId()); - Assertions.assertEquals("axkffei", model.eventHubName()); + Assertions.assertEquals("qduujitcjczdz", model.dataExportId()); + Assertions.assertEquals("ndhkrw", model.tableNames().get(0)); + Assertions.assertTrue(model.enable()); + Assertions.assertEquals("lgphu", model.createdDate()); + Assertions.assertEquals("cndvkaozwyiftyhx", model.lastModifiedDate()); + Assertions.assertEquals("usnhutje", model.resourceId()); + Assertions.assertEquals("dhugjzzdatqxhocd", model.eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataExportProperties model = new DataExportProperties().withDataExportId("svexcsonpclhoco") - .withTableNames(Arrays.asList("lkevle", "gz")) - .withEnable(false) - .withCreatedDate("vmezy") - .withLastModifiedDate("hxmzsbbzoggig") - .withResourceId("u") - .withEventHubName("axkffei"); + DataExportProperties model = new DataExportProperties().withDataExportId("qduujitcjczdz") + .withTableNames(Arrays.asList("ndhkrw", "d", "ppdsbdkvwrwj")) + .withEnable(true) + .withCreatedDate("lgphu") + .withLastModifiedDate("cndvkaozwyiftyhx") + .withResourceId("usnhutje") + .withEventHubName("dhugjzzdatqxhocd"); model = BinaryData.fromObject(model).toObject(DataExportProperties.class); - Assertions.assertEquals("svexcsonpclhoco", model.dataExportId()); - Assertions.assertEquals("lkevle", model.tableNames().get(0)); - Assertions.assertEquals(false, model.enable()); - Assertions.assertEquals("vmezy", model.createdDate()); - Assertions.assertEquals("hxmzsbbzoggig", model.lastModifiedDate()); - Assertions.assertEquals("u", model.resourceId()); - Assertions.assertEquals("axkffei", model.eventHubName()); + Assertions.assertEquals("qduujitcjczdz", model.dataExportId()); + Assertions.assertEquals("ndhkrw", model.tableNames().get(0)); + Assertions.assertTrue(model.enable()); + Assertions.assertEquals("lgphu", model.createdDate()); + Assertions.assertEquals("cndvkaozwyiftyhx", model.lastModifiedDate()); + Assertions.assertEquals("usnhutje", model.resourceId()); + Assertions.assertEquals("dhugjzzdatqxhocd", model.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java index fd97979e9f33..5089be2ae13d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataExport; @@ -22,33 +22,33 @@ public final class DataExportsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dataExportId\":\"lfmk\",\"tableNames\":[\"cazuaw\",\"tzxpuamwabzxrv\",\"cush\",\"phai\"],\"destination\":{\"resourceId\":\"xyasflvgsgzw\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"ihknsmjbl\"}},\"enable\":true,\"createdDate\":\"lnymzotqy\",\"lastModifiedDate\":\"uzcbmqq\"},\"id\":\"xmvwfg\",\"name\":\"ayxonsupeujl\",\"type\":\"qnhcvsqltnzoibg\"}"; + = "{\"properties\":{\"dataExportId\":\"crwnamikz\",\"tableNames\":[\"rqbsmswziq\",\"fuhok\",\"ruswhv\"],\"destination\":{\"resourceId\":\"zznvfbyc\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"wix\"}},\"enable\":true,\"createdDate\":\"wmxqhndvnoamlds\",\"lastModifiedDate\":\"aohdjh\"},\"id\":\"flzokxco\",\"name\":\"pelnjetag\",\"type\":\"tsxoatftgz\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DataExport response = manager.dataExports() - .define("igjkskyrio") - .withExistingWorkspace("hv", "slkvntjl") - .withDataExportId("idsxwaabzmifry") - .withTableNames(Arrays.asList("nmmaxrizkzob", "opxlhslnelxieixy", "llxecwc", "ojphslhc")) + .define("qwhix") + .withExistingWorkspace("rtixokff", "yinljqe") + .withDataExportId("stshiy") + .withTableNames(Arrays.asList("velfcldu", "cb")) .withEnable(true) - .withCreatedDate("n") - .withLastModifiedDate("ujeickp") - .withResourceId("jutifdwfmvigorqj") - .withEventHubName("raglk") + .withCreatedDate("tmninw") + .withLastModifiedDate("zcilnghg") + .withResourceId("ds") + .withEventHubName("b") .create(); - Assertions.assertEquals("lfmk", response.dataExportId()); - Assertions.assertEquals("cazuaw", response.tableNames().get(0)); - Assertions.assertEquals(true, response.enable()); - Assertions.assertEquals("lnymzotqy", response.createdDate()); - Assertions.assertEquals("uzcbmqq", response.lastModifiedDate()); - Assertions.assertEquals("xyasflvgsgzw", response.resourceId()); - Assertions.assertEquals("ihknsmjbl", response.eventHubName()); + Assertions.assertEquals("crwnamikz", response.dataExportId()); + Assertions.assertEquals("rqbsmswziq", response.tableNames().get(0)); + Assertions.assertTrue(response.enable()); + Assertions.assertEquals("wmxqhndvnoamlds", response.createdDate()); + Assertions.assertEquals("aohdjh", response.lastModifiedDate()); + Assertions.assertEquals("zznvfbyc", response.resourceId()); + Assertions.assertEquals("wix", response.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java index aa6e5e28ee07..f4d201295f7d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.dataExports() - .deleteWithResponse("cfhmlrqryxyn", "nzrdpsovwxz", "ptgoeiybbabp", com.azure.core.util.Context.NONE); + .deleteWithResponse("gicgaaoepttaq", "tdewemxswvruu", "zzjgehkfki", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java index 7cc8ab74fe0b..4130ea85ff98 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataExport; @@ -21,24 +21,25 @@ public final class DataExportsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dataExportId\":\"sdaultxij\",\"tableNames\":[\"mfqwa\"],\"destination\":{\"resourceId\":\"nqnm\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"qdqx\"}},\"enable\":false,\"createdDate\":\"gny\",\"lastModifiedDate\":\"sf\"},\"id\":\"svtui\",\"name\":\"zh\",\"type\":\"jqg\"}"; + = "{\"properties\":{\"dataExportId\":\"wbuqn\",\"tableNames\":[\"phzfylsgcrp\",\"bcunezzceze\",\"fwyfwlwxjwet\"],\"destination\":{\"resourceId\":\"sihclafzvaylp\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"wztcmwqkchc\"}},\"enable\":false,\"createdDate\":\"fewz\",\"lastModifiedDate\":\"jexfdeqvhp\"},\"id\":\"ylkkshkbffmbm\",\"name\":\"zjrgyww\",\"type\":\"gjxsnptfu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - DataExport response - = manager.dataExports().getWithResponse("jg", "yexaoguy", "i", com.azure.core.util.Context.NONE).getValue(); + DataExport response = manager.dataExports() + .getWithResponse("nsnvpd", "bmikost", "z", com.azure.core.util.Context.NONE) + .getValue(); - Assertions.assertEquals("sdaultxij", response.dataExportId()); - Assertions.assertEquals("mfqwa", response.tableNames().get(0)); - Assertions.assertEquals(false, response.enable()); - Assertions.assertEquals("gny", response.createdDate()); - Assertions.assertEquals("sf", response.lastModifiedDate()); - Assertions.assertEquals("nqnm", response.resourceId()); - Assertions.assertEquals("qdqx", response.eventHubName()); + Assertions.assertEquals("wbuqn", response.dataExportId()); + Assertions.assertEquals("phzfylsgcrp", response.tableNames().get(0)); + Assertions.assertFalse(response.enable()); + Assertions.assertEquals("fewz", response.createdDate()); + Assertions.assertEquals("jexfdeqvhp", response.lastModifiedDate()); + Assertions.assertEquals("sihclafzvaylp", response.resourceId()); + Assertions.assertEquals("wztcmwqkchc", response.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java index 87c97ad27ebf..1a604d6c6a7b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataExportsListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataExport; @@ -22,24 +22,24 @@ public final class DataExportsListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"dataExportId\":\"iljhahz\",\"tableNames\":[\"chndbnwie\",\"olewjwi\",\"ubwefqs\",\"ap\"],\"destination\":{\"resourceId\":\"tf\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"ex\"}},\"enable\":true,\"createdDate\":\"xap\",\"lastModifiedDate\":\"og\"},\"id\":\"qnobp\",\"name\":\"dcdab\",\"type\":\"qwpwyawbzasqbuc\"}]}"; + = "{\"value\":[{\"properties\":{\"dataExportId\":\"qpofvwbc\",\"tableNames\":[\"embnkbw\",\"qvxkd\",\"vqihebwtswbzuwf\",\"duragegizvc\"],\"destination\":{\"resourceId\":\"elisdjub\",\"type\":\"StorageAccount\",\"metaData\":{\"eventHubName\":\"gkxkbsazgakg\"}},\"enable\":true,\"createdDate\":\"cmjdmspof\",\"lastModifiedDate\":\"vuhrylni\"},\"id\":\"frzgbzjed\",\"name\":\"st\",\"type\":\"vnlvxbcuiiznktwf\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.dataExports().listByWorkspace("zejnhl", "kpbz", com.azure.core.util.Context.NONE); + = manager.dataExports().listByWorkspace("iiqbi", "htmwwinh", com.azure.core.util.Context.NONE); - Assertions.assertEquals("iljhahz", response.iterator().next().dataExportId()); - Assertions.assertEquals("chndbnwie", response.iterator().next().tableNames().get(0)); - Assertions.assertEquals(true, response.iterator().next().enable()); - Assertions.assertEquals("xap", response.iterator().next().createdDate()); - Assertions.assertEquals("og", response.iterator().next().lastModifiedDate()); - Assertions.assertEquals("tf", response.iterator().next().resourceId()); - Assertions.assertEquals("ex", response.iterator().next().eventHubName()); + Assertions.assertEquals("qpofvwbc", response.iterator().next().dataExportId()); + Assertions.assertEquals("embnkbw", response.iterator().next().tableNames().get(0)); + Assertions.assertTrue(response.iterator().next().enable()); + Assertions.assertEquals("cmjdmspof", response.iterator().next().createdDate()); + Assertions.assertEquals("vuhrylni", response.iterator().next().lastModifiedDate()); + Assertions.assertEquals("elisdjub", response.iterator().next().resourceId()); + Assertions.assertEquals("gkxkbsazgakg", response.iterator().next().eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java index e4167ab17473..2d28f321fc85 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceInnerTests.java @@ -15,23 +15,23 @@ public final class DataSourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataSourceInner model = BinaryData.fromString( - "{\"properties\":\"datakbldngkpocipa\",\"etag\":\"xoegukgjnpiucgy\",\"kind\":\"LinuxChangeTrackingPath\",\"tags\":{\"izcdrqjsd\":\"zntypmrb\",\"cwif\":\"ydnfyhxdeoejz\"},\"id\":\"jttgzf\",\"name\":\"ishc\",\"type\":\"khaj\"}") + "{\"properties\":\"dataasy\",\"etag\":\"nddhsgcbacph\",\"kind\":\"ChangeTrackingRegistry\",\"tags\":{\"ndlik\":\"tynqgoul\"},\"id\":\"yqkgfg\",\"name\":\"bmadgak\",\"type\":\"qsrxybzqqed\"}") .toObject(DataSourceInner.class); - Assertions.assertEquals("xoegukgjnpiucgy", model.etag()); - Assertions.assertEquals(DataSourceKind.LINUX_CHANGE_TRACKING_PATH, model.kind()); - Assertions.assertEquals("zntypmrb", model.tags().get("izcdrqjsd")); + Assertions.assertEquals("nddhsgcbacph", model.etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_REGISTRY, model.kind()); + Assertions.assertEquals("tynqgoul", model.tags().get("ndlik")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataSourceInner model = new DataSourceInner().withProperties("datakbldngkpocipa") - .withEtag("xoegukgjnpiucgy") - .withKind(DataSourceKind.LINUX_CHANGE_TRACKING_PATH) - .withTags(mapOf("izcdrqjsd", "zntypmrb", "cwif", "ydnfyhxdeoejz")); + DataSourceInner model = new DataSourceInner().withProperties("dataasy") + .withEtag("nddhsgcbacph") + .withKind(DataSourceKind.CHANGE_TRACKING_REGISTRY) + .withTags(mapOf("ndlik", "tynqgoul")); model = BinaryData.fromObject(model).toObject(DataSourceInner.class); - Assertions.assertEquals("xoegukgjnpiucgy", model.etag()); - Assertions.assertEquals(DataSourceKind.LINUX_CHANGE_TRACKING_PATH, model.kind()); - Assertions.assertEquals("zntypmrb", model.tags().get("izcdrqjsd")); + Assertions.assertEquals("nddhsgcbacph", model.etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_REGISTRY, model.kind()); + Assertions.assertEquals("tynqgoul", model.tags().get("ndlik")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java index 6432973976d0..8b745c80d1fe 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourceListResultTests.java @@ -17,42 +17,36 @@ public final class DataSourceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DataSourceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":\"dataeamdp\",\"etag\":\"g\",\"kind\":\"CustomLog\",\"tags\":{\"ow\":\"uxwgipwho\",\"injep\":\"gshwankixz\"},\"id\":\"ttmrywnuzoqf\",\"name\":\"iyqzrnk\",\"type\":\"qvyxlwhzlsicoho\"},{\"properties\":\"dataqnwvlrya\",\"etag\":\"hheunmmqhgyx\",\"kind\":\"ChangeTrackingDataTypeConfiguration\",\"tags\":{\"conuqszfkbeype\":\"ocukoklyax\"},\"id\":\"rmjmwvvjektc\",\"name\":\"senhwlrs\",\"type\":\"frzpwvlqdqgb\"},{\"properties\":\"dataqylihkaetckt\",\"etag\":\"civfsnkymuctq\",\"kind\":\"SqlDataClassification\",\"tags\":{\"fuwutttxf\":\"ebrjcxe\",\"hfnljkyq\":\"jrbirphxepcyv\",\"uujqgidokgjljyo\":\"j\",\"bgsncghkjeszzhb\":\"gvcl\"},\"id\":\"jhtxfvgxbfsmxne\",\"name\":\"mpvecxgodebfqk\",\"type\":\"rbmpukgri\"},{\"properties\":\"dataflz\",\"etag\":\"bxzpuzycisp\",\"kind\":\"CustomLogCollection\",\"tags\":{\"hibnuqqkpika\":\"hmgkbrpyy\",\"buynhijggm\":\"rgvtqag\"},\"id\":\"bfs\",\"name\":\"arbu\",\"type\":\"rcvpnazzmhjrunmp\"}],\"nextLink\":\"tdbhrbnla\"}") + "{\"value\":[{\"properties\":\"databciqfouflm\",\"etag\":\"kzsmodm\",\"kind\":\"ChangeTrackingServices\",\"tags\":{\"uqktap\":\"gpbkwtmut\",\"kdosvqw\":\"pwgcuertu\"},\"id\":\"bmdg\",\"name\":\"bjf\",\"type\":\"dgmb\"},{\"properties\":\"databexppb\",\"etag\":\"q\",\"kind\":\"ChangeTrackingContentLocation\",\"tags\":{\"jgzjaoyfhrtx\":\"fpfpsalgbquxigj\"},\"id\":\"lnerkujysvleju\",\"name\":\"fqawrlyxw\",\"type\":\"kcprbnw\"},{\"properties\":\"dataxgjvtbv\",\"etag\":\"sszdnru\",\"kind\":\"SecurityEventCollectionConfiguration\",\"tags\":{\"uitnwuiz\":\"hmuouqfprwzwbn\",\"x\":\"a\",\"hr\":\"fizuckyf\",\"zwdzuh\":\"idf\"},\"id\":\"ymwisdkft\",\"name\":\"wxmnteiwao\",\"type\":\"vkmijcmmxdcuf\"}],\"nextLink\":\"srp\"}") .toObject(DataSourceListResult.class); - Assertions.assertEquals("g", model.value().get(0).etag()); - Assertions.assertEquals(DataSourceKind.CUSTOM_LOG, model.value().get(0).kind()); - Assertions.assertEquals("uxwgipwho", model.value().get(0).tags().get("ow")); - Assertions.assertEquals("tdbhrbnla", model.nextLink()); + Assertions.assertEquals("kzsmodm", model.value().get(0).etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_SERVICES, model.value().get(0).kind()); + Assertions.assertEquals("gpbkwtmut", model.value().get(0).tags().get("uqktap")); + Assertions.assertEquals("srp", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DataSourceListResult model - = new DataSourceListResult() - .withValue(Arrays.asList( - new DataSourceInner().withProperties("dataeamdp") - .withEtag("g") - .withKind(DataSourceKind.CUSTOM_LOG) - .withTags(mapOf("ow", "uxwgipwho", "injep", "gshwankixz")), - new DataSourceInner().withProperties("dataqnwvlrya") - .withEtag("hheunmmqhgyx") - .withKind(DataSourceKind.CHANGE_TRACKING_DATA_TYPE_CONFIGURATION) - .withTags(mapOf("conuqszfkbeype", "ocukoklyax")), - new DataSourceInner().withProperties("dataqylihkaetckt") - .withEtag("civfsnkymuctq") - .withKind(DataSourceKind.SQL_DATA_CLASSIFICATION) - .withTags(mapOf("fuwutttxf", "ebrjcxe", "hfnljkyq", "jrbirphxepcyv", "uujqgidokgjljyo", "j", - "bgsncghkjeszzhb", "gvcl")), - new DataSourceInner().withProperties("dataflz") - .withEtag("bxzpuzycisp") - .withKind(DataSourceKind.CUSTOM_LOG_COLLECTION) - .withTags(mapOf("hibnuqqkpika", "hmgkbrpyy", "buynhijggm", "rgvtqag")))) - .withNextLink("tdbhrbnla"); + DataSourceListResult model = new DataSourceListResult() + .withValue(Arrays.asList( + new DataSourceInner().withProperties("databciqfouflm") + .withEtag("kzsmodm") + .withKind(DataSourceKind.CHANGE_TRACKING_SERVICES) + .withTags(mapOf("uqktap", "gpbkwtmut", "kdosvqw", "pwgcuertu")), + new DataSourceInner().withProperties("databexppb") + .withEtag("q") + .withKind(DataSourceKind.CHANGE_TRACKING_CONTENT_LOCATION) + .withTags(mapOf("jgzjaoyfhrtx", "fpfpsalgbquxigj")), + new DataSourceInner().withProperties("dataxgjvtbv") + .withEtag("sszdnru") + .withKind(DataSourceKind.SECURITY_EVENT_COLLECTION_CONFIGURATION) + .withTags(mapOf("uitnwuiz", "hmuouqfprwzwbn", "x", "a", "hr", "fizuckyf", "zwdzuh", "idf")))) + .withNextLink("srp"); model = BinaryData.fromObject(model).toObject(DataSourceListResult.class); - Assertions.assertEquals("g", model.value().get(0).etag()); - Assertions.assertEquals(DataSourceKind.CUSTOM_LOG, model.value().get(0).kind()); - Assertions.assertEquals("uxwgipwho", model.value().get(0).tags().get("ow")); - Assertions.assertEquals("tdbhrbnla", model.nextLink()); + Assertions.assertEquals("kzsmodm", model.value().get(0).etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_SERVICES, model.value().get(0).kind()); + Assertions.assertEquals("gpbkwtmut", model.value().get(0).tags().get("uqktap")); + Assertions.assertEquals("srp", model.nextLink()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java index c82310019a03..94d9917c64f4 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSource; @@ -24,27 +24,27 @@ public final class DataSourcesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":\"dataejjtbxqmul\",\"etag\":\"lxqzvn\",\"kind\":\"ChangeTrackingDataTypeConfiguration\",\"tags\":{\"qbsms\":\"ycucrwnamikzeb\",\"kzruswh\":\"ziqgfuh\",\"ycjsx\":\"hczznvf\",\"xqhndvnoamlds\":\"wwixzvumw\"},\"id\":\"haohdjhhflzokxc\",\"name\":\"xpelnjetagltsx\",\"type\":\"atftgzpnpbsw\"}"; + = "{\"properties\":\"datactctbrxkjz\",\"etag\":\"gxffmshkwf\",\"kind\":\"CustomLogCollection\",\"tags\":{\"clnapxbiygnugjkn\":\"zxwopdbydpizq\",\"oiquvrehmrnjhvs\":\"smfcttuxuuyilfl\"},\"id\":\"jztczytqj\",\"name\":\"w\",\"type\":\"auunfprnjletlx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DataSource response = manager.dataSources() - .define("jx") - .withExistingWorkspace("bffmbmxz", "rgywwp") - .withProperties("datanptfujgi") - .withKind(DataSourceKind.LINUX_SYSLOG) - .withTags(mapOf("gehkfkimrtixokff", "mxswvruunzz", "qwhix", "yinljqe", "i", "onsts")) - .withEtag("aaoepttaqut") + .define("wfl") + .withExistingWorkspace("p", "gqoweyirdhlisn") + .withProperties("dataqmp") + .withKind(DataSourceKind.CHANGE_TRACKING_PATH) + .withTags(mapOf("xtmkzjvkviir", "ngjsaasi")) + .withEtag("ruwnpqxpx") .create(); - Assertions.assertEquals("lxqzvn", response.etag()); - Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_DATA_TYPE_CONFIGURATION, response.kind()); - Assertions.assertEquals("ycucrwnamikzeb", response.tags().get("qbsms")); + Assertions.assertEquals("gxffmshkwf", response.etag()); + Assertions.assertEquals(DataSourceKind.CUSTOM_LOG_COLLECTION, response.kind()); + Assertions.assertEquals("zxwopdbydpizq", response.tags().get("clnapxbiygnugjkn")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java index d578c9558375..d54dcb41f86a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,9 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.dataSources() - .deleteWithResponse("xgnxfyqonmpqoxwd", "fdbxiqxeiiqbim", "tmwwi", com.azure.core.util.Context.NONE); + manager.dataSources().deleteWithResponse("npbs", "vefloccsrmozihmi", "g", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java index 59d8090c48f3..54519497c59e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSource; @@ -22,21 +22,21 @@ public final class DataSourcesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":\"datakbwvqvxkdiv\",\"etag\":\"heb\",\"kind\":\"ChangeTrackingRegistry\",\"tags\":{\"gi\":\"bzuwfmdurag\",\"igkxkbsazga\":\"vcjfelisdjubggb\",\"apvu\":\"gacyrcmjdmspo\",\"zjedmstkvnlv\":\"rylniofrzg\"},\"id\":\"bcuiiz\",\"name\":\"ktwfa\",\"type\":\"snvpdibmi\"}"; + = "{\"properties\":\"dataztrksxwpndf\",\"etag\":\"fnznth\",\"kind\":\"SecurityEventCollectionConfiguration\",\"tags\":{\"amktcqiosmgbzah\":\"jaosrxuzv\",\"tz\":\"xqdlyrtltlapr\",\"s\":\"atbhjmznn\"},\"id\":\"qeqala\",\"name\":\"vlagun\",\"type\":\"tgfebwln\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); DataSource response = manager.dataSources() - .getWithResponse("h", "hfqpofv", "bcblemb", com.azure.core.util.Context.NONE) + .getWithResponse("wtxxpkyjcx", "jxgrytfmp", "ycilrmcaykggnox", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("heb", response.etag()); - Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_REGISTRY, response.kind()); - Assertions.assertEquals("bzuwfmdurag", response.tags().get("gi")); + Assertions.assertEquals("fnznth", response.etag()); + Assertions.assertEquals(DataSourceKind.SECURITY_EVENT_COLLECTION_CONFIGURATION, response.kind()); + Assertions.assertEquals("jaosrxuzv", response.tags().get("amktcqiosmgbzah")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java index 00be625a916f..e89ecf5dc62f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DataSourcesListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSource; @@ -23,20 +23,20 @@ public final class DataSourcesListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":\"datalfwyfwlwxjwetn\",\"etag\":\"ihclafzv\",\"kind\":\"WindowsPerformanceCounter\",\"tags\":{\"tcmwqkchc\":\"trsqqw\"},\"id\":\"waxfewzjkj\",\"name\":\"xfdeqvhpsyl\",\"type\":\"ksh\"}]}"; + = "{\"value\":[{\"properties\":\"dataqtobaxkjeyt\",\"etag\":\"lbfjkwr\",\"kind\":\"ChangeTrackingContentLocation\",\"tags\":{\"njqhdenxa\":\"qbhsyrq\"},\"id\":\"l\",\"name\":\"pakdkifmjnnawt\",\"type\":\"abpxuc\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.dataSources() - .listByWorkspace("ostbzbkiwb", "qnyophzfyls", "crpfbcunez", "cez", com.azure.core.util.Context.NONE); + .listByWorkspace("mhyreeudz", "av", "pdqmjxlyyzglgouw", "lmjjyuo", com.azure.core.util.Context.NONE); - Assertions.assertEquals("ihclafzv", response.iterator().next().etag()); - Assertions.assertEquals(DataSourceKind.WINDOWS_PERFORMANCE_COUNTER, response.iterator().next().kind()); - Assertions.assertEquals("trsqqw", response.iterator().next().tags().get("tcmwqkchc")); + Assertions.assertEquals("lbfjkwr", response.iterator().next().etag()); + Assertions.assertEquals(DataSourceKind.CHANGE_TRACKING_CONTENT_LOCATION, response.iterator().next().kind()); + Assertions.assertEquals("qbhsyrq", response.iterator().next().tags().get("njqhdenxa")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java index 0a2347b703b1..58b23a2b1a39 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListByResourceGroupMockTests.java @@ -7,11 +7,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -26,38 +25,38 @@ public final class DeletedWorkspacesListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"customerId\":\"qyn\",\"sku\":{\"name\":\"Standalone\",\"capacityReservationLevel\":200,\"lastSkuUpdate\":\"aq\"},\"retentionInDays\":530847681,\"workspaceCapping\":{\"dailyQuotaGb\":80.1550882239485,\"quotaNextResetTime\":\"hwddkvbxgkq\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"w\",\"modifiedDate\":\"dacarvvlfnty\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"erohzrsqalsxkdn\",\"scopeId\":\"apfgsdpcvessm\"},{\"resourceId\":\"h\",\"scopeId\":\"uipldqq\"},{\"resourceId\":\"ekvalblhtjq\",\"scopeId\":\"yvwehtaemxh\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"ivzrrryveimipsk\",\"disableLocalAuth\":true,\"\":{\"tjvv\":\"datavfuzka\"}},\"defaultDataCollectionRuleResourceId\":\"xwigsye\"},\"identity\":{\"principalId\":\"dsmjtgr\",\"tenantId\":\"dgkkile\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"ygbdgwumgxdgdhpa\":{\"principalId\":\"mknhwtbbaedor\",\"clientId\":\"mqfl\"},\"tefhexcgjokjl\":{\"principalId\":\"dexjddvjs\",\"clientId\":\"wotmmwllcolsrsxa\"}}},\"systemData\":{\"createdBy\":\"v\",\"createdByType\":\"Key\",\"createdAt\":\"2021-11-03T13:01:45Z\",\"lastModifiedBy\":\"peeksnbksdqhjv\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-07-06T01:14:39Z\"},\"etag\":\"lkhhu\",\"location\":\"tcpoqma\",\"tags\":{\"jkxyb\":\"qjwgoknlej\",\"jbzten\":\"fdb\"},\"id\":\"vkzykjtjknsxf\",\"name\":\"us\",\"type\":\"cdp\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"uqndaizupfkhuy\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":1048467054,\"lastSkuUpdate\":\"2021-11-22T12:40:39Z\"},\"retentionInDays\":1254328830,\"workspaceCapping\":{\"dailyQuotaGb\":12.895250494222898,\"quotaNextResetTime\":\"qiukvzwyd\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"2021-02-07T19:45:29Z\",\"modifiedDate\":\"2021-08-08T18:31:32Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"shajqf\",\"scopeId\":\"peexpgeumilhwuit\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"fninbdbzs\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"mpcbbprtugav\",\"zbcyksiv\"],\"tbfcm\":\"datagd\"},\"defaultDataCollectionRuleResourceId\":\"ftsjcwj\",\"replication\":{\"location\":\"gmbawvifdxk\",\"enabled\":false,\"provisioningState\":\"RollingBack\",\"createdDate\":\"2021-01-30T06:13:56Z\",\"lastModifiedDate\":\"2021-11-01T17:33:31Z\"},\"failover\":{\"state\":\"Activating\",\"lastModifiedDate\":\"2021-08-18T18:47:44Z\"}},\"identity\":{\"principalId\":\"txvcm\",\"tenantId\":\"unlcpxxv\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"iahxmfqryarvs\":{\"principalId\":\"ngjgvrquvpyg\",\"clientId\":\"pmcrdcuelj\"},\"tgblioskkfmk\":{\"principalId\":\"qbglcjkaysp\",\"clientId\":\"zodubtlm\"}}},\"etag\":\"jxyxgb\",\"location\":\"kqvjcteoedlr\",\"tags\":{\"pxvjnzd\":\"kk\",\"pcnab\":\"vocoj\",\"nggy\":\"zf\",\"vzilmhiv\":\"e\"},\"id\":\"kwwwnckn\",\"name\":\"zdajlskzptjxu\",\"type\":\"weucyrth\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.deletedWorkspaces().listByResourceGroup("djus", com.azure.core.util.Context.NONE); + = manager.deletedWorkspaces().listByResourceGroup("ldtzmpypefcp", com.azure.core.util.Context.NONE); - Assertions.assertEquals("tcpoqma", response.iterator().next().location()); - Assertions.assertEquals("qjwgoknlej", response.iterator().next().tags().get("jkxyb")); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("lkhhu", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(530847681, response.iterator().next().retentionInDays()); - Assertions.assertEquals(80.1550882239485D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals("kqvjcteoedlr", response.iterator().next().location()); + Assertions.assertEquals("kk", response.iterator().next().tags().get("pxvjnzd")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals("jxyxgb", response.iterator().next().etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); + Assertions.assertEquals(1048467054, response.iterator().next().sku().capacityReservationLevel()); + Assertions.assertEquals(1254328830, response.iterator().next().retentionInDays()); + Assertions.assertEquals(12.895250494222898D, response.iterator().next().workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, response.iterator().next().publicNetworkAccessForIngestion()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(false, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(false, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("ivzrrryveimipsk", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(true, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("xwigsye", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertFalse(response.iterator().next().forceCmkForQuery()); + Assertions.assertFalse(response.iterator().next().features().enableDataExport()); + Assertions.assertFalse(response.iterator().next().features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("fninbdbzs", response.iterator().next().features().clusterResourceId()); + Assertions.assertTrue(response.iterator().next().features().disableLocalAuth()); + Assertions.assertEquals("ftsjcwj", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("gmbawvifdxk", response.iterator().next().replication().location()); + Assertions.assertFalse(response.iterator().next().replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java index 891c3528ebe5..fc8bf7ed34a5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DeletedWorkspacesListMockTests.java @@ -7,11 +7,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -26,37 +25,37 @@ public final class DeletedWorkspacesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Canceled\",\"customerId\":\"ztwhghmupg\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":200,\"lastSkuUpdate\":\"xabb\"},\"retentionInDays\":1038396263,\"workspaceCapping\":{\"dailyQuotaGb\":38.243065707057745,\"quotaNextResetTime\":\"bbklqpxzuca\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"wwnlzafwxudgnh\",\"modifiedDate\":\"okrtalvnb\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"lvdjjukyr\",\"scopeId\":\"qo\"},{\"resourceId\":\"ahhxhqfaqnvzoqg\",\"scopeId\":\"pem\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"ejdtxptl\",\"disableLocalAuth\":true,\"\":{\"j\":\"dataomew\",\"uhqawmoaianc\":\"datatl\",\"blxydkxr\":\"datanvodrrs\"}},\"defaultDataCollectionRuleResourceId\":\"vbxiwkgfbqlj\"},\"identity\":{\"principalId\":\"hychocokuleh\",\"tenantId\":\"qlrqffaweyurk\",\"type\":\"key\",\"userAssignedIdentities\":{\"rxmrgchbapx\":{\"principalId\":\"xra\",\"clientId\":\"uqd\"},\"bajbuscgduusi\":{\"principalId\":\"y\",\"clientId\":\"j\"},\"kyxl\":{\"principalId\":\"cblevpmc\",\"clientId\":\"jy\"},\"vdwnapfdqwowft\":{\"principalId\":\"sjgkzzltafh\",\"clientId\":\"ffovwmbjlzqsczp\"}}},\"systemData\":{\"createdBy\":\"uwjtks\",\"createdByType\":\"Key\",\"createdAt\":\"2021-07-07T02:15:20Z\",\"lastModifiedBy\":\"y\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-04-28T02:09:32Z\"},\"etag\":\"q\",\"location\":\"hvyeldotj\",\"tags\":{\"spkxkdt\":\"wiswskukjtasbvw\",\"vtwknvgmmbugt\":\"fkndl\",\"kueatgroeshoy\":\"watmqa\",\"kfaoytehq\":\"zcbyfq\"},\"id\":\"uvjmv\",\"name\":\"mtdwcky\",\"type\":\"roejnndl\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"togmhmjpjscdfpd\",\"sku\":{\"name\":\"CapacityReservation\",\"capacityReservationLevel\":1893346412,\"lastSkuUpdate\":\"2021-07-14T18:14:24Z\"},\"retentionInDays\":1189635916,\"workspaceCapping\":{\"dailyQuotaGb\":44.46311972703302,\"quotaNextResetTime\":\"rxifvqnrx\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"2020-12-23T21:27:45Z\",\"modifiedDate\":\"2021-09-18T16:52:07Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"SecuredByPerimeter\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"qpxlb\",\"scopeId\":\"akftng\"},{\"resourceId\":\"wmykyutry\",\"scopeId\":\"wmfjhp\"},{\"resourceId\":\"vjqdvdwkq\",\"scopeId\":\"drlefgnaavuag\"},{\"resourceId\":\"etaoutnpdc\",\"scopeId\":\"hspfefyihd\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"mtybkcgsu\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"wynefx\",\"x\",\"fciatxtjrr\",\"kmdskjhhxd\"],\"cvslxlhuavkrmukm\":\"datafoxcx\",\"qid\":\"datajmkxettcslojf\",\"tkbtnqlrngl\":\"dataqtoqxjhqxcsq\",\"nxhhl\":\"datambiipsnawwlqk\"},\"defaultDataCollectionRuleResourceId\":\"ricctkwmuqqoa\",\"replication\":{\"location\":\"iygle\",\"enabled\":true,\"provisioningState\":\"RollbackRequested\",\"createdDate\":\"2021-08-22T14:39:56Z\",\"lastModifiedDate\":\"2021-01-05T18:05:21Z\"},\"failover\":{\"state\":\"Active\",\"lastModifiedDate\":\"2021-01-06T05:50:32Z\"}},\"identity\":{\"principalId\":\"kbrup\",\"tenantId\":\"ehdmljzacvumep\",\"type\":\"None\",\"userAssignedIdentities\":{\"cjclykcgxv\":{\"principalId\":\"nzpphepife\",\"clientId\":\"eqir\"},\"u\":{\"principalId\":\"jlvczu\",\"clientId\":\"ac\"}}},\"etag\":\"tepdjxqes\",\"location\":\"oy\",\"tags\":{\"skwxe\":\"ylpckaewsedv\",\"fn\":\"qphr\"},\"id\":\"hctmjtsgh\",\"name\":\"bcbcpz\",\"type\":\"rpzeqac\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.deletedWorkspaces().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("hvyeldotj", response.iterator().next().location()); - Assertions.assertEquals("wiswskukjtasbvw", response.iterator().next().tags().get("spkxkdt")); - Assertions.assertEquals(IdentityType.KEY, response.iterator().next().identity().type()); - Assertions.assertEquals("q", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(1038396263, response.iterator().next().retentionInDays()); - Assertions.assertEquals(38.243065707057745D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals("oy", response.iterator().next().location()); + Assertions.assertEquals("ylpckaewsedv", response.iterator().next().tags().get("skwxe")); + Assertions.assertEquals(IdentityType.NONE, response.iterator().next().identity().type()); + Assertions.assertEquals("tepdjxqes", response.iterator().next().etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, response.iterator().next().sku().name()); + Assertions.assertEquals(1893346412, response.iterator().next().sku().capacityReservationLevel()); + Assertions.assertEquals(1189635916, response.iterator().next().retentionInDays()); + Assertions.assertEquals(44.46311972703302D, response.iterator().next().workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.iterator().next().publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(true, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(true, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("ejdtxptl", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(true, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("vbxiwkgfbqlj", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertTrue(response.iterator().next().forceCmkForQuery()); + Assertions.assertFalse(response.iterator().next().features().enableDataExport()); + Assertions.assertTrue(response.iterator().next().features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("mtybkcgsu", response.iterator().next().features().clusterResourceId()); + Assertions.assertTrue(response.iterator().next().features().disableLocalAuth()); + Assertions.assertEquals("ricctkwmuqqoa", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("iygle", response.iterator().next().replication().location()); + Assertions.assertTrue(response.iterator().next().replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java index 3a73f10f1616..76c288c6e4d9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationMetadataTests.java @@ -12,14 +12,14 @@ public final class DestinationMetadataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { DestinationMetadata model - = BinaryData.fromString("{\"eventHubName\":\"uknvudwti\"}").toObject(DestinationMetadata.class); - Assertions.assertEquals("uknvudwti", model.eventHubName()); + = BinaryData.fromString("{\"eventHubName\":\"kgiawxklryplwck\"}").toObject(DestinationMetadata.class); + Assertions.assertEquals("kgiawxklryplwck", model.eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - DestinationMetadata model = new DestinationMetadata().withEventHubName("uknvudwti"); + DestinationMetadata model = new DestinationMetadata().withEventHubName("kgiawxklryplwck"); model = BinaryData.fromObject(model).toObject(DestinationMetadata.class); - Assertions.assertEquals("uknvudwti", model.eventHubName()); + Assertions.assertEquals("kgiawxklryplwck", model.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java index 4d08fdd12af4..ef10a1cda898 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/DestinationTests.java @@ -12,18 +12,17 @@ public final class DestinationTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Destination model = BinaryData - .fromString( - "{\"resourceId\":\"xwburvjxxjns\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"koen\"}}") + .fromString("{\"resourceId\":\"urokft\",\"type\":\"EventHub\",\"metaData\":{\"eventHubName\":\"iwpwcuk\"}}") .toObject(Destination.class); - Assertions.assertEquals("xwburvjxxjns", model.resourceId()); - Assertions.assertEquals("koen", model.eventHubName()); + Assertions.assertEquals("urokft", model.resourceId()); + Assertions.assertEquals("iwpwcuk", model.eventHubName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Destination model = new Destination().withResourceId("xwburvjxxjns").withEventHubName("koen"); + Destination model = new Destination().withResourceId("urokft").withEventHubName("iwpwcuk"); model = BinaryData.fromObject(model).toObject(Destination.class); - Assertions.assertEquals("xwburvjxxjns", model.resourceId()); - Assertions.assertEquals("koen", model.eventHubName()); + Assertions.assertEquals("urokft", model.resourceId()); + Assertions.assertEquals("iwpwcuk", model.eventHubName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java index 7b433126c9b0..98739141551f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/GatewaysDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.gateways().deleteWithResponse("jwtrhtgvgzp", "rrkolawjmjs", "wro", com.azure.core.util.Context.NONE); + manager.gateways().deleteWithResponse("mr", "ddoui", "amowaziynknlqwzd", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java index c7ff9ea8ee6d..15bb6dc73575 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IdentityTests.java @@ -16,17 +16,18 @@ public final class IdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Identity model = BinaryData.fromString( - "{\"principalId\":\"yl\",\"tenantId\":\"ool\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"urdoi\":{\"principalId\":\"iwkkbn\",\"clientId\":\"rywvtylbfpn\"}}}") + "{\"principalId\":\"e\",\"tenantId\":\"lfg\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"duvwpklvxwmygd\":{\"principalId\":\"kwdlenrdsutujba\",\"clientId\":\"juohminyflnorw\"},\"bjcrxgibbdaxco\":{\"principalId\":\"gpqch\",\"clientId\":\"zepn\"}}}") .toObject(Identity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.type()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Identity model = new Identity().withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("urdoi", new UserIdentityProperties())); + Identity model = new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities( + mapOf("duvwpklvxwmygd", new UserIdentityProperties(), "bjcrxgibbdaxco", new UserIdentityProperties())); model = BinaryData.fromObject(model).toObject(Identity.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.type()); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.type()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java index 9b26c589211a..8b5b484fb648 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePackInnerTests.java @@ -12,20 +12,20 @@ public final class IntelligencePackInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { IntelligencePackInner model - = BinaryData.fromString("{\"name\":\"xmyskp\",\"enabled\":true,\"displayName\":\"btkcxywnytnrsyn\"}") + = BinaryData.fromString("{\"name\":\"zidnsezcxtbzsgfy\",\"enabled\":false,\"displayName\":\"ewmdw\"}") .toObject(IntelligencePackInner.class); - Assertions.assertEquals("xmyskp", model.name()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("btkcxywnytnrsyn", model.displayName()); + Assertions.assertEquals("zidnsezcxtbzsgfy", model.name()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("ewmdw", model.displayName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { IntelligencePackInner model - = new IntelligencePackInner().withName("xmyskp").withEnabled(true).withDisplayName("btkcxywnytnrsyn"); + = new IntelligencePackInner().withName("zidnsezcxtbzsgfy").withEnabled(false).withDisplayName("ewmdw"); model = BinaryData.fromObject(model).toObject(IntelligencePackInner.class); - Assertions.assertEquals("xmyskp", model.name()); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("btkcxywnytnrsyn", model.displayName()); + Assertions.assertEquals("zidnsezcxtbzsgfy", model.name()); + Assertions.assertFalse(model.enabled()); + Assertions.assertEquals("ewmdw", model.displayName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java index 5f7ab2cf0601..4c8e3becb5fb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksDisableWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDisableWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.intelligencePacks() - .disableWithResponse("e", "loccsrmozihm", "pgawtxxpkyjcxcjx", com.azure.core.util.Context.NONE); + .disableWithResponse("piwhxqs", "dtmaa", "quhuxylrj", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java index f9cf202b49cd..bac7d11c9fe1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksEnableWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testEnableWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.intelligencePacks() - .enableWithResponse("rytfmpcycil", "mcayk", "gnoxuztrksx", com.azure.core.util.Context.NONE); + .enableWithResponse("m", "ygjbmzyospspsh", "kfkyjp", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java index 5055a4ea2785..9b2dbe3126ca 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/IntelligencePacksListWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.IntelligencePack; @@ -21,22 +21,21 @@ public final class IntelligencePacksListWithResponseMockTests { @Test public void testListWithResponse() throws Exception { - String responseStr - = "[{\"name\":\"zvoamktc\",\"enabled\":false,\"displayName\":\"mgbzahgxqdlyrtl\"},{\"name\":\"ap\",\"enabled\":false,\"displayName\":\"katbhjm\"},{\"name\":\"nbsoqeqalarv\",\"enabled\":true,\"displayName\":\"nbtgfebwl\"}]"; + String responseStr = "[{\"name\":\"tvczkcnyxr\",\"enabled\":false,\"displayName\":\"jdxvglnkvxlxpa\"}]"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); List response = manager.intelligencePacks() - .listWithResponse("pndfcpfnznt", "jtwkjaos", com.azure.core.util.Context.NONE) + .listWithResponse("sp", "pssdfppyogtie", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("zvoamktc", response.get(0).name()); - Assertions.assertEquals(false, response.get(0).enabled()); - Assertions.assertEquals("mgbzahgxqdlyrtl", response.get(0).displayName()); + Assertions.assertEquals("tvczkcnyxr", response.get(0).name()); + Assertions.assertFalse(response.get(0).enabled()); + Assertions.assertEquals("jdxvglnkvxlxpa", response.get(0).displayName()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java index a19e21dc77ed..0cef0b25e34b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceInnerTests.java @@ -15,25 +15,27 @@ public final class LinkedServiceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinkedServiceInner model = BinaryData.fromString( - "{\"properties\":{\"resourceId\":\"idybyxczf\",\"writeAccessResourceId\":\"haaxdbabphl\",\"provisioningState\":\"ProvisioningAccount\"},\"tags\":{\"azt\":\"ktsthsucocmny\"},\"id\":\"bt\",\"name\":\"wrqpue\",\"type\":\"ckzywbiexzfeyue\"}") + "{\"properties\":{\"resourceId\":\"eiachboosflnr\",\"writeAccessResourceId\":\"fqpte\",\"provisioningState\":\"Updating\"},\"tags\":{\"swjdkirso\":\"ypyqrimzinp\",\"soifiyipjxsqw\":\"dqxhcrmnohjtckwh\",\"bznorcjxvsnby\":\"gr\",\"cyshurzafbljjgp\":\"qabnmoc\"},\"id\":\"toqcjmklja\",\"name\":\"bqidtqaj\",\"type\":\"yulpkudjkr\"}") .toObject(LinkedServiceInner.class); - Assertions.assertEquals("ktsthsucocmny", model.tags().get("azt")); - Assertions.assertEquals("idybyxczf", model.resourceId()); - Assertions.assertEquals("haaxdbabphl", model.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT, model.provisioningState()); + Assertions.assertEquals("ypyqrimzinp", model.tags().get("swjdkirso")); + Assertions.assertEquals("eiachboosflnr", model.resourceId()); + Assertions.assertEquals("fqpte", model.writeAccessResourceId()); + Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinkedServiceInner model = new LinkedServiceInner().withTags(mapOf("azt", "ktsthsucocmny")) - .withResourceId("idybyxczf") - .withWriteAccessResourceId("haaxdbabphl") - .withProvisioningState(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT); + LinkedServiceInner model = new LinkedServiceInner() + .withTags(mapOf("swjdkirso", "ypyqrimzinp", "soifiyipjxsqw", "dqxhcrmnohjtckwh", "bznorcjxvsnby", "gr", + "cyshurzafbljjgp", "qabnmoc")) + .withResourceId("eiachboosflnr") + .withWriteAccessResourceId("fqpte") + .withProvisioningState(LinkedServiceEntityStatus.UPDATING); model = BinaryData.fromObject(model).toObject(LinkedServiceInner.class); - Assertions.assertEquals("ktsthsucocmny", model.tags().get("azt")); - Assertions.assertEquals("idybyxczf", model.resourceId()); - Assertions.assertEquals("haaxdbabphl", model.writeAccessResourceId()); - Assertions.assertEquals(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT, model.provisioningState()); + Assertions.assertEquals("ypyqrimzinp", model.tags().get("swjdkirso")); + Assertions.assertEquals("eiachboosflnr", model.resourceId()); + Assertions.assertEquals("fqpte", model.writeAccessResourceId()); + Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java index c02e8f9b63bc..310f04aa9cbd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServiceListResultTests.java @@ -17,29 +17,37 @@ public final class LinkedServiceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinkedServiceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"resourceId\":\"aepdkzjanc\",\"writeAccessResourceId\":\"rhdwbavxbniw\",\"provisioningState\":\"Deleting\"},\"tags\":{\"ytxhp\":\"tsdbpgn\"},\"id\":\"xbzpfzab\",\"name\":\"lcuhxwtctyqiklb\",\"type\":\"ovplw\"},{\"properties\":{\"resourceId\":\"hvgyuguosvmk\",\"writeAccessResourceId\":\"sxqu\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"lpvlopw\":\"gmgsxnkjzkde\"},\"id\":\"yighxpk\",\"name\":\"wzbaiue\",\"type\":\"baumnyqupedeoj\"}]}") + "{\"value\":[{\"properties\":{\"resourceId\":\"c\",\"writeAccessResourceId\":\"ierhhbcsglummaj\",\"provisioningState\":\"Deleting\"},\"tags\":{\"jionpimexgstxgc\":\"xobnbdxkqpxok\"},\"id\":\"odgmaajrmvdjwz\",\"name\":\"lovmclwhijcoe\",\"type\":\"ctbzaq\"},{\"properties\":{\"resourceId\":\"sycbkbfk\",\"writeAccessResourceId\":\"kdkexxp\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"vpmouexhdzxib\":\"axcfjpgddtocjjx\",\"wndeicbtwnp\":\"eojnxqbzvddn\",\"hcffcyddglmjthjq\":\"aoqvuh\",\"hix\":\"wpyeicxmqciwqvh\"},\"id\":\"igdtopbob\",\"name\":\"og\",\"type\":\"m\"},{\"properties\":{\"resourceId\":\"u\",\"writeAccessResourceId\":\"a\",\"provisioningState\":\"Deleting\"},\"tags\":{\"kftutqxlngxlefg\":\"yvvtpgvdfgio\",\"rvqdra\":\"gnxkrxdqmidtth\",\"skanyk\":\"hjybigehoqfbo\"},\"id\":\"zlcuiywgqywgndrv\",\"name\":\"nhzgpphrcgyn\",\"type\":\"ocpecfvmmco\"}]}") .toObject(LinkedServiceListResult.class); - Assertions.assertEquals("tsdbpgn", model.value().get(0).tags().get("ytxhp")); - Assertions.assertEquals("aepdkzjanc", model.value().get(0).resourceId()); - Assertions.assertEquals("rhdwbavxbniw", model.value().get(0).writeAccessResourceId()); + Assertions.assertEquals("xobnbdxkqpxok", model.value().get(0).tags().get("jionpimexgstxgc")); + Assertions.assertEquals("c", model.value().get(0).resourceId()); + Assertions.assertEquals("ierhhbcsglummaj", model.value().get(0).writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.DELETING, model.value().get(0).provisioningState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LinkedServiceListResult model = new LinkedServiceListResult().withValue(Arrays.asList( - new LinkedServiceInner().withTags(mapOf("ytxhp", "tsdbpgn")) - .withResourceId("aepdkzjanc") - .withWriteAccessResourceId("rhdwbavxbniw") + new LinkedServiceInner().withTags(mapOf("jionpimexgstxgc", "xobnbdxkqpxok")) + .withResourceId("c") + .withWriteAccessResourceId("ierhhbcsglummaj") .withProvisioningState(LinkedServiceEntityStatus.DELETING), - new LinkedServiceInner().withTags(mapOf("lpvlopw", "gmgsxnkjzkde")) - .withResourceId("hvgyuguosvmk") - .withWriteAccessResourceId("sxqu") - .withProvisioningState(LinkedServiceEntityStatus.SUCCEEDED))); + new LinkedServiceInner() + .withTags(mapOf("vpmouexhdzxib", "axcfjpgddtocjjx", "wndeicbtwnp", "eojnxqbzvddn", "hcffcyddglmjthjq", + "aoqvuh", "hix", "wpyeicxmqciwqvh")) + .withResourceId("sycbkbfk") + .withWriteAccessResourceId("kdkexxp") + .withProvisioningState(LinkedServiceEntityStatus.SUCCEEDED), + new LinkedServiceInner() + .withTags( + mapOf("kftutqxlngxlefg", "yvvtpgvdfgio", "rvqdra", "gnxkrxdqmidtth", "skanyk", "hjybigehoqfbo")) + .withResourceId("u") + .withWriteAccessResourceId("a") + .withProvisioningState(LinkedServiceEntityStatus.DELETING))); model = BinaryData.fromObject(model).toObject(LinkedServiceListResult.class); - Assertions.assertEquals("tsdbpgn", model.value().get(0).tags().get("ytxhp")); - Assertions.assertEquals("aepdkzjanc", model.value().get(0).resourceId()); - Assertions.assertEquals("rhdwbavxbniw", model.value().get(0).writeAccessResourceId()); + Assertions.assertEquals("xobnbdxkqpxok", model.value().get(0).tags().get("jionpimexgstxgc")); + Assertions.assertEquals("c", model.value().get(0).resourceId()); + Assertions.assertEquals("ierhhbcsglummaj", model.value().get(0).writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.DELETING, model.value().get(0).provisioningState()); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java index 1921880c37b5..d9655c34abc1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicePropertiesTests.java @@ -14,21 +14,21 @@ public final class LinkedServicePropertiesTests { public void testDeserialize() throws Exception { LinkedServiceProperties model = BinaryData .fromString( - "{\"resourceId\":\"ibx\",\"writeAccessResourceId\":\"wbhqwal\",\"provisioningState\":\"Updating\"}") + "{\"resourceId\":\"hbzhfepg\",\"writeAccessResourceId\":\"qex\",\"provisioningState\":\"Updating\"}") .toObject(LinkedServiceProperties.class); - Assertions.assertEquals("ibx", model.resourceId()); - Assertions.assertEquals("wbhqwal", model.writeAccessResourceId()); + Assertions.assertEquals("hbzhfepg", model.resourceId()); + Assertions.assertEquals("qex", model.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinkedServiceProperties model = new LinkedServiceProperties().withResourceId("ibx") - .withWriteAccessResourceId("wbhqwal") + LinkedServiceProperties model = new LinkedServiceProperties().withResourceId("hbzhfepg") + .withWriteAccessResourceId("qex") .withProvisioningState(LinkedServiceEntityStatus.UPDATING); model = BinaryData.fromObject(model).toObject(LinkedServiceProperties.class); - Assertions.assertEquals("ibx", model.resourceId()); - Assertions.assertEquals("wbhqwal", model.writeAccessResourceId()); + Assertions.assertEquals("hbzhfepg", model.resourceId()); + Assertions.assertEquals("qex", model.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, model.provisioningState()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java index 8aa374bd1815..d6ae94e707f5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesCreateOrUpdateMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedService; @@ -24,27 +24,27 @@ public final class LinkedServicesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"resourceId\":\"psw\",\"writeAccessResourceId\":\"mvkhlggd\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"jfpgpicrmn\":\"qkzszuwiwtglxxh\",\"mqgjsxvpq\":\"hr\",\"bakclacjfrnxous\":\"bfrmbodthsqqgvri\"},\"id\":\"au\",\"name\":\"lwvsgm\",\"type\":\"ohqfzizv\"}"; + = "{\"properties\":{\"resourceId\":\"n\",\"writeAccessResourceId\":\"xjawrt\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"vnekhenlusfnrdtj\":\"yccxlzhcox\",\"ttgepuslvyjtcv\":\"txrdcqtjvi\"},\"id\":\"wkasiziesf\",\"name\":\"ughtuqfecjxeygtu\",\"type\":\"xu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LinkedService response = manager.linkedServices() - .define("yp") - .withExistingWorkspace("aglqivbgkcvkh", "zvuqdflvon") - .withTags(mapOf("fgpikqm", "bgqjxgpnrhgo")) - .withResourceId("ubcpzgpxti") - .withWriteAccessResourceId("j") - .withProvisioningState(LinkedServiceEntityStatus.PROVISIONING_ACCOUNT) + .define("obkauxofsh") + .withExistingWorkspace("c", "uahokq") + .withTags(mapOf("gsnnf", "fgf", "coc", "yetefyp", "urmlmuo", "fjgtixrjvzuy")) + .withResourceId("hwpnulaiywzejywh") + .withWriteAccessResourceId("wkojpllndnpd") + .withProvisioningState(LinkedServiceEntityStatus.UPDATING) .create(); - Assertions.assertEquals("qkzszuwiwtglxxh", response.tags().get("jfpgpicrmn")); - Assertions.assertEquals("psw", response.resourceId()); - Assertions.assertEquals("mvkhlggd", response.writeAccessResourceId()); + Assertions.assertEquals("yccxlzhcox", response.tags().get("vnekhenlusfnrdtj")); + Assertions.assertEquals("n", response.resourceId()); + Assertions.assertEquals("xjawrt", response.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.SUCCEEDED, response.provisioningState()); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java index e12a213a1bd0..dcbd77e0b1a7 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedService; @@ -22,21 +22,21 @@ public final class LinkedServicesDeleteMockTests { @Test public void testDelete() throws Exception { String responseStr - = "{\"properties\":{\"resourceId\":\"mjjyuojq\",\"writeAccessResourceId\":\"baxk\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"jkwrusnkq\":\"nlb\",\"hdenxaulk\":\"hsyrqunj\",\"xuckpggqoweyir\":\"akdkifmjnnawtqab\"},\"id\":\"hlisngw\",\"name\":\"lqqmpiz\",\"type\":\"uwnpqxpxiwfcng\"}"; + = "{\"properties\":{\"resourceId\":\"dibgqjxgpnrhgov\",\"writeAccessResourceId\":\"pikqmh\",\"provisioningState\":\"Succeeded\"},\"tags\":{\"qzdfuydzvkfvxcn\":\"rmzvupo\",\"psw\":\"mx\",\"gdhbe\":\"kmvkhl\"},\"id\":\"zqkzszuwi\",\"name\":\"tglxx\",\"type\":\"ljfp\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - LinkedService response - = manager.linkedServices().delete("bmhyreeudz", "av", "pdqmjxlyyzglgouw", com.azure.core.util.Context.NONE); + LinkedService response = manager.linkedServices() + .delete("lqivbgkcv", "hpzvuqdflvoniyp", "pubcpzgpxtivhjk", com.azure.core.util.Context.NONE); - Assertions.assertEquals("nlb", response.tags().get("jkwrusnkq")); - Assertions.assertEquals("mjjyuojq", response.resourceId()); - Assertions.assertEquals("baxk", response.writeAccessResourceId()); + Assertions.assertEquals("rmzvupo", response.tags().get("qzdfuydzvkfvxcn")); + Assertions.assertEquals("dibgqjxgpnrhgov", response.resourceId()); + Assertions.assertEquals("pikqmh", response.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.SUCCEEDED, response.provisioningState()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java index cc7e7adb9e22..ea01d54b8a76 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedService; @@ -22,22 +22,22 @@ public final class LinkedServicesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"resourceId\":\"atzv\",\"writeAccessResourceId\":\"glbyvi\",\"provisioningState\":\"Updating\"},\"tags\":{\"fbkgozxwopdby\":\"rxkjzwrgxffmshk\",\"zqaclna\":\"p\"},\"id\":\"xbiygnugjknfsmf\",\"name\":\"ttuxuuyilflqoiqu\",\"type\":\"rehmr\"}"; + = "{\"properties\":{\"resourceId\":\"rnxousxauzlwvsg\",\"writeAccessResourceId\":\"ohqfzizv\",\"provisioningState\":\"Updating\"},\"tags\":{\"mribiat\":\"jsvthnwpzteko\",\"zcugswvxwlmzqw\":\"gplucfotangcfhny\",\"cvclxynpdk\":\"vtxnjmxmcuqud\",\"neiknpg\":\"gfabuiyjibuzphdu\"},\"id\":\"xgjiuqh\",\"name\":\"btozipqwje\",\"type\":\"mur\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LinkedService response = manager.linkedServices() - .getWithResponse("saasiixtmkzj", "kv", "irhgfgrwsdp", com.azure.core.util.Context.NONE) + .getWithResponse("picrmnzhrgmqgjsx", "pqcbfrmbodthsq", "gvriibakclac", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("rxkjzwrgxffmshk", response.tags().get("fbkgozxwopdby")); - Assertions.assertEquals("atzv", response.resourceId()); - Assertions.assertEquals("glbyvi", response.writeAccessResourceId()); + Assertions.assertEquals("jsvthnwpzteko", response.tags().get("mribiat")); + Assertions.assertEquals("rnxousxauzlwvsg", response.resourceId()); + Assertions.assertEquals("ohqfzizv", response.writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.UPDATING, response.provisioningState()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java index c3737d885ea1..ee55a5c65b90 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedServicesListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedService; @@ -23,21 +23,21 @@ public final class LinkedServicesListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"resourceId\":\"njle\",\"writeAccessResourceId\":\"xsmrpddouifamow\",\"provisioningState\":\"Deleting\"},\"tags\":{\"tmaaj\":\"knlqwzdvpiwhxqsz\",\"bmzyospsps\":\"uhuxylrjvmtyg\",\"fkyjpmspbpssdfpp\":\"c\"},\"id\":\"ogtieyujtvczkcny\",\"name\":\"rxmunjdxvgln\",\"type\":\"vxlx\"}]}"; + = "{\"value\":[{\"properties\":{\"resourceId\":\"cgwgcloxoebqinji\",\"writeAccessResourceId\":\"wjfuj\",\"provisioningState\":\"Deleting\"},\"tags\":{\"filkmkkholv\":\"bahhpzpofoiyjw\",\"ukyefchnmnahmnxh\":\"ndviauogphuartvt\",\"fifhxwrsnew\":\"xjqirwrweoox\",\"sycxhxzgaz\":\"ozqvbubqmam\"},\"id\":\"taboidvmf\",\"name\":\"hppubowsepdfgkmt\",\"type\":\"herngb\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.linkedServices().listByWorkspace("jhvsujztczyt", "jtwhauunf", com.azure.core.util.Context.NONE); + = manager.linkedServices().listByWorkspace("xxgewpk", "vqylkmqpzoyhl", com.azure.core.util.Context.NONE); - Assertions.assertEquals("knlqwzdvpiwhxqsz", response.iterator().next().tags().get("tmaaj")); - Assertions.assertEquals("njle", response.iterator().next().resourceId()); - Assertions.assertEquals("xsmrpddouifamow", response.iterator().next().writeAccessResourceId()); + Assertions.assertEquals("bahhpzpofoiyjw", response.iterator().next().tags().get("filkmkkholv")); + Assertions.assertEquals("cgwgcloxoebqinji", response.iterator().next().resourceId()); + Assertions.assertEquals("wjfuj", response.iterator().next().writeAccessResourceId()); Assertions.assertEquals(LinkedServiceEntityStatus.DELETING, response.iterator().next().provisioningState()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java index c1bcb4df7e9e..d48b9a981fa2 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSourceType; @@ -23,21 +23,21 @@ public final class LinkedStorageAccountsCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dataSourceType\":\"Alerts\",\"storageAccountIds\":[\"k\",\"jqirwrw\",\"ooxf\",\"i\"]},\"id\":\"hx\",\"name\":\"rsnewmozqvbubqma\",\"type\":\"hsycxhxzgaz\"}"; + = "{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"qogsfikayian\"]},\"id\":\"haru\",\"name\":\"t\",\"type\":\"iqxf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LinkedStorageAccountsResource response = manager.linkedStorageAccounts() .define(DataSourceType.QUERY) - .withExistingWorkspace("jipnwj", "ujqlafcbahh") - .withStorageAccountIds(Arrays.asList("iyjwpfilkmkkho")) + .withExistingWorkspace("dirazf", "xejw") + .withStorageAccountIds(Arrays.asList("tmvcop", "xcmjurbu")) .create(); - Assertions.assertEquals("k", response.storageAccountIds().get(0)); + Assertions.assertEquals("qogsfikayian", response.storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java index 40493a52e050..8e903ac007f6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSourceType; @@ -26,10 +26,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.linkedStorageAccounts() - .deleteWithResponse("xmmkjs", "thnwpzte", DataSourceType.QUERY, com.azure.core.util.Context.NONE); + .deleteWithResponse("cbuewmrswnjlxuz", "hwpusxj", DataSourceType.QUERY, com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java index d10dd144a0b4..c573d8bbe878 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.DataSourceType; @@ -22,20 +22,19 @@ public final class LinkedStorageAccountsGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"wvxwlmzqwmvt\",\"njmxmcuqudtcvcl\",\"ynpdkvgfab\"]},\"id\":\"iyji\",\"name\":\"uzphdugnei\",\"type\":\"n\"}"; + = "{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"fepbnwgfmxjgc\",\"bjb\",\"dlfgtdysnaq\"]},\"id\":\"flq\",\"name\":\"ctqhamzjrwdk\",\"type\":\"zeqyjleziun\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LinkedStorageAccountsResource response = manager.linkedStorageAccounts() - .getWithResponse("vmribiat", "gplucfotangcfhny", DataSourceType.CUSTOM_LOGS, - com.azure.core.util.Context.NONE) + .getWithResponse("qehgpd", "hzjqatucoige", DataSourceType.ALERTS, com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("wvxwlmzqwmvt", response.storageAccountIds().get(0)); + Assertions.assertEquals("fepbnwgfmxjgc", response.storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java index aa5e03209483..1653382012f8 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LinkedStorageAccountsResource; @@ -22,18 +22,18 @@ public final class LinkedStorageAccountsListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"d\",\"urrxxgewpktv\",\"ylkmqp\"]},\"id\":\"o\",\"name\":\"hlfbcgwgc\",\"type\":\"oxoebqi\"}]}"; + = "{\"value\":[{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"nseqacjjvp\",\"lguooqjagmd\",\"tg\",\"eiookjbsah\"]},\"id\":\"tdtpdelqacslmo\",\"name\":\"oebn\",\"type\":\"xofvcjk\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.linkedStorageAccounts().listByWorkspace("gox", "jiuqhibtozi", com.azure.core.util.Context.NONE); + = manager.linkedStorageAccounts().listByWorkspace("xdfzantkw", "eg", com.azure.core.util.Context.NONE); - Assertions.assertEquals("d", response.iterator().next().storageAccountIds().get(0)); + Assertions.assertEquals("nseqacjjvp", response.iterator().next().storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java index dd4162a279cc..72e9c44c5402 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsListResultTests.java @@ -14,21 +14,18 @@ public final class LinkedStorageAccountsListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinkedStorageAccountsListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"vce\",\"vei\",\"ovnotyfjfcnjbkcn\",\"dhbt\"]},\"id\":\"kphywpnvjto\",\"name\":\"nermcl\",\"type\":\"plpho\"},{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"pabgyeps\",\"jta\"]},\"id\":\"qugxywpmueefjzwf\",\"name\":\"kqujidsuyono\",\"type\":\"glaocq\"},{\"properties\":{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"g\",\"udxytlmoyrx\",\"wfudwpzntxhdzhl\",\"qj\"]},\"id\":\"hckfrlhrx\",\"name\":\"bkyvp\",\"type\":\"ca\"},{\"properties\":{\"dataSourceType\":\"CustomLogs\",\"storageAccountIds\":[\"zka\"]},\"id\":\"kuwbcrnwb\",\"name\":\"ehhseyvjusrts\",\"type\":\"hspkdeemao\"}]}") + "{\"value\":[{\"properties\":{\"dataSourceType\":\"CustomLogs\",\"storageAccountIds\":[\"ipheoflokeyyien\",\"bdlwtgrhpdjpj\",\"masxazjpqyegu\",\"lhbxxhejjzzvdud\"]},\"id\":\"wdslfhotwmcy\",\"name\":\"pwlbjnpg\",\"type\":\"cftadeh\"},{\"properties\":{\"dataSourceType\":\"Alerts\",\"storageAccountIds\":[\"fsoppusuesnzw\",\"ej\"]},\"id\":\"avo\",\"name\":\"xzdmohctb\",\"type\":\"vudwx\"}]}") .toObject(LinkedStorageAccountsListResult.class); - Assertions.assertEquals("vce", model.value().get(0).storageAccountIds().get(0)); + Assertions.assertEquals("ipheoflokeyyien", model.value().get(0).storageAccountIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LinkedStorageAccountsListResult model = new LinkedStorageAccountsListResult().withValue(Arrays.asList( - new LinkedStorageAccountsResourceInner() - .withStorageAccountIds(Arrays.asList("vce", "vei", "ovnotyfjfcnjbkcn", "dhbt")), - new LinkedStorageAccountsResourceInner().withStorageAccountIds(Arrays.asList("pabgyeps", "jta")), - new LinkedStorageAccountsResourceInner() - .withStorageAccountIds(Arrays.asList("g", "udxytlmoyrx", "wfudwpzntxhdzhl", "qj")), - new LinkedStorageAccountsResourceInner().withStorageAccountIds(Arrays.asList("zka")))); + new LinkedStorageAccountsResourceInner().withStorageAccountIds( + Arrays.asList("ipheoflokeyyien", "bdlwtgrhpdjpj", "masxazjpqyegu", "lhbxxhejjzzvdud")), + new LinkedStorageAccountsResourceInner().withStorageAccountIds(Arrays.asList("fsoppusuesnzw", "ej")))); model = BinaryData.fromObject(model).toObject(LinkedStorageAccountsListResult.class); - Assertions.assertEquals("vce", model.value().get(0).storageAccountIds().get(0)); + Assertions.assertEquals("ipheoflokeyyien", model.value().get(0).storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java index 9832736ff713..0646d7918b9a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsPropertiesTests.java @@ -12,17 +12,17 @@ public final class LinkedStorageAccountsPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - LinkedStorageAccountsProperties model - = BinaryData.fromString("{\"dataSourceType\":\"AzureWatson\",\"storageAccountIds\":[\"sx\"]}") - .toObject(LinkedStorageAccountsProperties.class); - Assertions.assertEquals("sx", model.storageAccountIds().get(0)); + LinkedStorageAccountsProperties model = BinaryData.fromString( + "{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"nwsubisnj\",\"mpmngnzscxaqwoo\",\"hcbonqvpkvlr\"]}") + .toObject(LinkedStorageAccountsProperties.class); + Assertions.assertEquals("nwsubisnj", model.storageAccountIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LinkedStorageAccountsProperties model - = new LinkedStorageAccountsProperties().withStorageAccountIds(Arrays.asList("sx")); + LinkedStorageAccountsProperties model = new LinkedStorageAccountsProperties() + .withStorageAccountIds(Arrays.asList("nwsubisnj", "mpmngnzscxaqwoo", "hcbonqvpkvlr")); model = BinaryData.fromObject(model).toObject(LinkedStorageAccountsProperties.class); - Assertions.assertEquals("sx", model.storageAccountIds().get(0)); + Assertions.assertEquals("nwsubisnj", model.storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java index 66a4b51c423d..57ce7268faaf 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LinkedStorageAccountsResourceInnerTests.java @@ -13,16 +13,16 @@ public final class LinkedStorageAccountsResourceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LinkedStorageAccountsResourceInner model = BinaryData.fromString( - "{\"properties\":{\"dataSourceType\":\"Query\",\"storageAccountIds\":[\"hsmtxpsiebtfhvp\",\"sapskr\",\"qmhjjdhtld\"]},\"id\":\"kyzxuutk\",\"name\":\"cwscwsvlx\",\"type\":\"togt\"}") + "{\"properties\":{\"dataSourceType\":\"Ingestion\",\"storageAccountIds\":[\"zevgb\",\"qjqabcypmivkwl\",\"uvcc\"]},\"id\":\"wnfnbacf\",\"name\":\"onlebxetqgtzxdpn\",\"type\":\"bqqwxrj\"}") .toObject(LinkedStorageAccountsResourceInner.class); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.storageAccountIds().get(0)); + Assertions.assertEquals("zevgb", model.storageAccountIds().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LinkedStorageAccountsResourceInner model = new LinkedStorageAccountsResourceInner() - .withStorageAccountIds(Arrays.asList("hsmtxpsiebtfhvp", "sapskr", "qmhjjdhtld")); + .withStorageAccountIds(Arrays.asList("zevgb", "qjqabcypmivkwl", "uvcc")); model = BinaryData.fromObject(model).toObject(LinkedStorageAccountsResourceInner.class); - Assertions.assertEquals("hsmtxpsiebtfhvp", model.storageAccountIds().get(0)); + Assertions.assertEquals("zevgb", model.storageAccountIds().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java index f562a725ec27..ddaba19b2e18 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackInnerTests.java @@ -14,19 +14,19 @@ public final class LogAnalyticsQueryPackInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackInner model = BinaryData.fromString( - "{\"properties\":{\"queryPackId\":\"ijbpzvgnwzsymgl\",\"timeCreated\":\"2021-09-05T16:59:27Z\",\"timeModified\":\"2021-02-27T08:20:44Z\",\"provisioningState\":\"ohdbihanufh\"},\"location\":\"cbjy\",\"tags\":{\"xwczbyscnp\":\"ithxqhabifpi\"},\"id\":\"x\",\"name\":\"hiv\",\"type\":\"qniwbybrkxvdumj\"}") + "{\"properties\":{\"queryPackId\":\"vlvqhjkbegi\",\"timeCreated\":\"2021-03-26T15:32:51Z\",\"timeModified\":\"2021-02-11T17:20:18Z\",\"provisioningState\":\"ebwwaloayqc\"},\"location\":\"rtzju\",\"tags\":{\"txon\":\"yzm\",\"rknftguvriuhprwm\":\"mtsavjcbpwxqp\",\"bexrmcq\":\"yvxqtayriwwroy\"},\"id\":\"bycnojvkn\",\"name\":\"e\",\"type\":\"qsgzvahapj\"}") .toObject(LogAnalyticsQueryPackInner.class); - Assertions.assertEquals("cbjy", model.location()); - Assertions.assertEquals("ithxqhabifpi", model.tags().get("xwczbyscnp")); + Assertions.assertEquals("rtzju", model.location()); + Assertions.assertEquals("yzm", model.tags().get("txon")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackInner model - = new LogAnalyticsQueryPackInner().withLocation("cbjy").withTags(mapOf("xwczbyscnp", "ithxqhabifpi")); + LogAnalyticsQueryPackInner model = new LogAnalyticsQueryPackInner().withLocation("rtzju") + .withTags(mapOf("txon", "yzm", "rknftguvriuhprwm", "mtsavjcbpwxqp", "bexrmcq", "yvxqtayriwwroy")); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackInner.class); - Assertions.assertEquals("cbjy", model.location()); - Assertions.assertEquals("ithxqhabifpi", model.tags().get("xwczbyscnp")); + Assertions.assertEquals("rtzju", model.location()); + Assertions.assertEquals("yzm", model.tags().get("txon")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java index 9bbc678f07ca..2eeff82cfbe9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackListResultTests.java @@ -16,27 +16,26 @@ public final class LogAnalyticsQueryPackListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"queryPackId\":\"hq\",\"timeCreated\":\"2021-08-01T15:29:09Z\",\"timeModified\":\"2021-10-26T10:24:19Z\",\"provisioningState\":\"ybczmehmtzo\"},\"location\":\"bsphrupidgsybbe\",\"tags\":{\"xaobhdxbmtqioqjz\":\"hoycm\"},\"id\":\"htbmuf\",\"name\":\"ownoizhw\",\"type\":\"rxybqsoq\"},{\"properties\":{\"queryPackId\":\"gkdmb\",\"timeCreated\":\"2021-12-03T16:46:54Z\",\"timeModified\":\"2021-03-24T06:15:27Z\",\"provisioningState\":\"c\"},\"location\":\"fp\",\"tags\":{\"qqjnqgl\":\"rbt\",\"foooj\":\"qgn\",\"saagdf\":\"wifsq\"},\"id\":\"glzlhjxrifkwmrv\",\"name\":\"tsizntocipaoua\",\"type\":\"psqucmpoyf\"},{\"properties\":{\"queryPackId\":\"fogknygjofjdde\",\"timeCreated\":\"2020-12-22T06:05:56Z\",\"timeModified\":\"2021-06-07T09:35:57Z\",\"provisioningState\":\"pewnw\"},\"location\":\"eitjz\",\"tags\":{\"hs\":\"usarhmofc\",\"xukcdmpar\":\"yurkdtmlxhekuksj\"},\"id\":\"ryuanzwuxzdxtay\",\"name\":\"lhmwhfpmrqobm\",\"type\":\"u\"}],\"nextLink\":\"nryrtihf\"}") + "{\"value\":[{\"properties\":{\"queryPackId\":\"r\",\"timeCreated\":\"2021-06-09T13:42:27Z\",\"timeModified\":\"2021-10-13T05:34:59Z\",\"provisioningState\":\"omzlfmi\"},\"location\":\"wbnb\",\"tags\":{\"urqhaka\":\"dawkzbali\",\"xcug\":\"hashsfwxosow\",\"ovbvmeueciv\":\"cjooxdjebwpucwwf\",\"otwmcdyt\":\"hzceuojgjrwjue\"},\"id\":\"x\",\"name\":\"it\",\"type\":\"nrjawgqwg\"},{\"properties\":{\"queryPackId\":\"ni\",\"timeCreated\":\"2021-10-14T20:39:54Z\",\"timeModified\":\"2021-05-28T01:48:43Z\",\"provisioningState\":\"py\"},\"location\":\"klwndnhjdauwhv\",\"tags\":{\"xujznbmpowu\":\"zbtd\",\"lupj\":\"przqlveu\"},\"id\":\"khfxobbcswsrt\",\"name\":\"riplrbpbewtg\",\"type\":\"fgb\"}],\"nextLink\":\"gw\"}") .toObject(LogAnalyticsQueryPackListResult.class); - Assertions.assertEquals("bsphrupidgsybbe", model.value().get(0).location()); - Assertions.assertEquals("hoycm", model.value().get(0).tags().get("xaobhdxbmtqioqjz")); - Assertions.assertEquals("nryrtihf", model.nextLink()); + Assertions.assertEquals("wbnb", model.value().get(0).location()); + Assertions.assertEquals("dawkzbali", model.value().get(0).tags().get("urqhaka")); + Assertions.assertEquals("gw", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LogAnalyticsQueryPackListResult model = new LogAnalyticsQueryPackListResult().withValue(Arrays.asList( - new LogAnalyticsQueryPackInner().withLocation("bsphrupidgsybbe") - .withTags(mapOf("xaobhdxbmtqioqjz", "hoycm")), - new LogAnalyticsQueryPackInner().withLocation("fp") - .withTags(mapOf("qqjnqgl", "rbt", "foooj", "qgn", "saagdf", "wifsq")), - new LogAnalyticsQueryPackInner().withLocation("eitjz") - .withTags(mapOf("hs", "usarhmofc", "xukcdmpar", "yurkdtmlxhekuksj")))) - .withNextLink("nryrtihf"); + new LogAnalyticsQueryPackInner().withLocation("wbnb") + .withTags(mapOf("urqhaka", "dawkzbali", "xcug", "hashsfwxosow", "ovbvmeueciv", "cjooxdjebwpucwwf", + "otwmcdyt", "hzceuojgjrwjue")), + new LogAnalyticsQueryPackInner().withLocation("klwndnhjdauwhv") + .withTags(mapOf("xujznbmpowu", "zbtd", "lupj", "przqlveu")))) + .withNextLink("gw"); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackListResult.class); - Assertions.assertEquals("bsphrupidgsybbe", model.value().get(0).location()); - Assertions.assertEquals("hoycm", model.value().get(0).tags().get("xaobhdxbmtqioqjz")); - Assertions.assertEquals("nryrtihf", model.nextLink()); + Assertions.assertEquals("wbnb", model.value().get(0).location()); + Assertions.assertEquals("dawkzbali", model.value().get(0).tags().get("urqhaka")); + Assertions.assertEquals("gw", model.nextLink()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java index 0083d9b1c802..8519059f3572 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackPropertiesTests.java @@ -11,7 +11,7 @@ public final class LogAnalyticsQueryPackPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackProperties model = BinaryData.fromString( - "{\"queryPackId\":\"tfwvukxgaudc\",\"timeCreated\":\"2021-06-07T10:34:36Z\",\"timeModified\":\"2021-03-15T16:07:05Z\",\"provisioningState\":\"cnyejhkryhtnapcz\"}") + "{\"queryPackId\":\"hpvgqz\",\"timeCreated\":\"2021-01-17T14:10:43Z\",\"timeModified\":\"2021-03-29T21:57:57Z\",\"provisioningState\":\"jzlmw\"}") .toObject(LogAnalyticsQueryPackProperties.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java index 06a46115ccdf..e9775cc4a340 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryInnerTests.java @@ -16,35 +16,37 @@ public final class LogAnalyticsQueryPackQueryInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQueryInner model = BinaryData.fromString( - "{\"properties\":{\"id\":\"qwpgrjbzn\",\"displayName\":\"rcjxvsnbyxqabn\",\"timeCreated\":\"2021-06-16T16:14:14Z\",\"timeModified\":\"2020-12-28T20:56:17Z\",\"author\":\"shurzafbljjgpbto\",\"description\":\"jmkljavbqidtqajz\",\"body\":\"ulpkudjkrl\",\"related\":{\"categories\":[\"hfepgzgqex\"],\"resourceTypes\":[\"c\",\"scpai\",\"rhhbcs\",\"l\"],\"solutions\":[\"a\",\"tjaodxobnb\"]},\"tags\":{\"mexgstxgcp\":[\"pxokajionp\"]},\"properties\":\"datagmaajrm\"},\"id\":\"jwzrl\",\"name\":\"mcl\",\"type\":\"ijcoejctb\"}") + "{\"properties\":{\"id\":\"bebrjcxerfuwuttt\",\"displayName\":\"fvjrbirphxepcy\",\"timeCreated\":\"2021-11-07T03:18:20Z\",\"timeModified\":\"2021-05-23T19:09:39Z\",\"author\":\"jky\",\"description\":\"j\",\"body\":\"uujqgidokgjljyo\",\"related\":{\"categories\":[\"ltbgsncghkj\",\"szzhbijhtxfvgxbf\",\"mxnehmp\",\"ec\"],\"resourceTypes\":[\"debfqkkrbmpukgri\",\"flz\",\"fbxzpuzycisp\",\"qzahmgkbrp\"],\"solutions\":[\"hibnuqqkpika\",\"rgvtqag\"]},\"tags\":{\"ttdbhrbnl\":[\"nhijggmebfsi\",\"rbu\",\"rcvpnazzmhjrunmp\"],\"czfc\":[\"kx\",\"yskpbhen\",\"tkcxywnytnrsy\",\"lqidyby\"]},\"properties\":\"dataaaxdbabphlwrq\"},\"id\":\"ktsthsucocmny\",\"name\":\"azt\",\"type\":\"bt\"}") .toObject(LogAnalyticsQueryPackQueryInner.class); - Assertions.assertEquals("rcjxvsnbyxqabn", model.displayName()); - Assertions.assertEquals("jmkljavbqidtqajz", model.description()); - Assertions.assertEquals("ulpkudjkrl", model.body()); - Assertions.assertEquals("hfepgzgqex", model.related().categories().get(0)); - Assertions.assertEquals("c", model.related().resourceTypes().get(0)); - Assertions.assertEquals("a", model.related().solutions().get(0)); - Assertions.assertEquals("pxokajionp", model.tags().get("mexgstxgcp").get(0)); + Assertions.assertEquals("fvjrbirphxepcy", model.displayName()); + Assertions.assertEquals("j", model.description()); + Assertions.assertEquals("uujqgidokgjljyo", model.body()); + Assertions.assertEquals("ltbgsncghkj", model.related().categories().get(0)); + Assertions.assertEquals("debfqkkrbmpukgri", model.related().resourceTypes().get(0)); + Assertions.assertEquals("hibnuqqkpika", model.related().solutions().get(0)); + Assertions.assertEquals("nhijggmebfsi", model.tags().get("ttdbhrbnl").get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryInner model = new LogAnalyticsQueryPackQueryInner().withDisplayName("rcjxvsnbyxqabn") - .withDescription("jmkljavbqidtqajz") - .withBody("ulpkudjkrl") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("hfepgzgqex")) - .withResourceTypes(Arrays.asList("c", "scpai", "rhhbcs", "l")) - .withSolutions(Arrays.asList("a", "tjaodxobnb"))) - .withTags(mapOf("mexgstxgcp", Arrays.asList("pxokajionp"))) - .withProperties("datagmaajrm"); + LogAnalyticsQueryPackQueryInner model = new LogAnalyticsQueryPackQueryInner().withDisplayName("fvjrbirphxepcy") + .withDescription("j") + .withBody("uujqgidokgjljyo") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("ltbgsncghkj", "szzhbijhtxfvgxbf", "mxnehmp", "ec")) + .withResourceTypes(Arrays.asList("debfqkkrbmpukgri", "flz", "fbxzpuzycisp", "qzahmgkbrp")) + .withSolutions(Arrays.asList("hibnuqqkpika", "rgvtqag"))) + .withTags(mapOf("ttdbhrbnl", Arrays.asList("nhijggmebfsi", "rbu", "rcvpnazzmhjrunmp"), "czfc", + Arrays.asList("kx", "yskpbhen", "tkcxywnytnrsy", "lqidyby"))) + .withProperties("dataaaxdbabphlwrq"); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryInner.class); - Assertions.assertEquals("rcjxvsnbyxqabn", model.displayName()); - Assertions.assertEquals("jmkljavbqidtqajz", model.description()); - Assertions.assertEquals("ulpkudjkrl", model.body()); - Assertions.assertEquals("hfepgzgqex", model.related().categories().get(0)); - Assertions.assertEquals("c", model.related().resourceTypes().get(0)); - Assertions.assertEquals("a", model.related().solutions().get(0)); - Assertions.assertEquals("pxokajionp", model.tags().get("mexgstxgcp").get(0)); + Assertions.assertEquals("fvjrbirphxepcy", model.displayName()); + Assertions.assertEquals("j", model.description()); + Assertions.assertEquals("uujqgidokgjljyo", model.body()); + Assertions.assertEquals("ltbgsncghkj", model.related().categories().get(0)); + Assertions.assertEquals("debfqkkrbmpukgri", model.related().resourceTypes().get(0)); + Assertions.assertEquals("hibnuqqkpika", model.related().solutions().get(0)); + Assertions.assertEquals("nhijggmebfsi", model.tags().get("ttdbhrbnl").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java index bdf11fd483c3..6a9bbc95acaf 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryListResultTests.java @@ -17,67 +17,42 @@ public final class LogAnalyticsQueryPackQueryListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQueryListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"id\":\"yhuybbkpod\",\"displayName\":\"po\",\"timeCreated\":\"2021-05-29T14:24:22Z\",\"timeModified\":\"2021-09-25T10:25:19Z\",\"author\":\"amiheognarxz\",\"description\":\"heotusiv\",\"body\":\"evcciqihnhun\",\"related\":{\"categories\":[\"zrnf\",\"gxg\"],\"resourceTypes\":[\"emv\",\"zfkufubljofx\",\"eofjaeqjh\",\"jbasvmsmjqulngs\"],\"solutions\":[\"bybkzgcwrwclxx\",\"rljdouskcqv\",\"ocrcjdk\",\"tnhxbn\"]},\"tags\":{\"yqduujit\":[\"sqrglssainq\",\"jwnzlljfmp\",\"eebvmgxsab\"],\"nhutjeltmrldhugj\":[\"czdzev\",\"dhkrwpdappdsbdk\",\"wrwjfeu\"]},\"properties\":\"datadatqxhocdgeabl\"},\"id\":\"huticndvkao\",\"name\":\"yiftyhxhuro\",\"type\":\"tyxolniwpwc\"},{\"properties\":{\"id\":\"kgiawxklryplwck\",\"displayName\":\"asy\",\"timeCreated\":\"2021-10-21T22:29:11Z\",\"timeModified\":\"2021-07-26T02:42:45Z\",\"author\":\"sgcbac\",\"description\":\"ejk\",\"body\":\"tynqgoul\",\"related\":{\"categories\":[\"i\",\"wyqkgfgibm\",\"dgak\"],\"resourceTypes\":[\"rxybz\"],\"solutions\":[\"dqytbciqfouflmm\"]},\"tags\":{\"spwgcuertumkdosv\":[\"modmglougpb\",\"wtmutduq\",\"ta\"]},\"properties\":\"datahbmdgbbjfdd\"},\"id\":\"bmbexppbhtqqro\",\"name\":\"p\",\"type\":\"s\"},{\"properties\":{\"id\":\"qux\",\"displayName\":\"gjyjgzjaoyfhrtxi\",\"timeCreated\":\"2021-04-23T04:18:15Z\",\"timeModified\":\"2021-08-05T02:52:01Z\",\"author\":\"jysvl\",\"description\":\"uvfqawrlyxwj\",\"body\":\"cpr\",\"related\":{\"categories\":[\"xgjvtbv\"],\"resourceTypes\":[\"szdnr\",\"jq\"],\"solutions\":[\"muouqfp\",\"wzwbnguitn\",\"uizga\",\"x\"]},\"tags\":{\"idf\":[\"uckyf\",\"hr\"],\"pvkmijcmmxdcuf\":[\"wdzuhtymwisd\",\"fthwxmnteiwa\"],\"dwzjeiach\":[\"srp\",\"mzidnsezcxtb\",\"sgfyccsnew\"],\"pyqr\":[\"osfln\",\"osfqpteehzzv\"]},\"properties\":\"dataz\"},\"id\":\"pvswjdkirso\",\"name\":\"qxhcrmn\",\"type\":\"jtckwhdso\"}],\"nextLink\":\"yip\"}") + "{\"value\":[{\"properties\":{\"id\":\"nvudwtiukb\",\"displayName\":\"dng\",\"timeCreated\":\"2021-01-23T10:58:05Z\",\"timeModified\":\"2021-05-04T07:17:38Z\",\"author\":\"azyxoegukg\",\"description\":\"piu\",\"body\":\"gygev\",\"related\":{\"categories\":[\"yp\",\"rbpizc\",\"r\",\"j\"],\"resourceTypes\":[\"ydnfyhxdeoejz\"],\"solutions\":[\"ifsjttgzfbishcb\"]},\"tags\":{\"kix\":[\"deyeamdphagalpbu\",\"wgipwhono\",\"kgshwa\"],\"ttmrywnuzoqf\":[\"injep\"],\"oqqnwvlryav\":[\"yqzrnkcqvyxlw\",\"zlsico\"],\"szfkbe\":[\"heun\",\"mqhgyxzkonocuk\",\"klyaxuconu\"]},\"properties\":\"dataewrmjmwvvjektc\"},\"id\":\"enhwlrs\",\"name\":\"frzpwvlqdqgb\",\"type\":\"qylihkaetckt\"}],\"nextLink\":\"civfsnkymuctq\"}") .toObject(LogAnalyticsQueryPackQueryListResult.class); - Assertions.assertEquals("po", model.value().get(0).displayName()); - Assertions.assertEquals("heotusiv", model.value().get(0).description()); - Assertions.assertEquals("evcciqihnhun", model.value().get(0).body()); - Assertions.assertEquals("zrnf", model.value().get(0).related().categories().get(0)); - Assertions.assertEquals("emv", model.value().get(0).related().resourceTypes().get(0)); - Assertions.assertEquals("bybkzgcwrwclxx", model.value().get(0).related().solutions().get(0)); - Assertions.assertEquals("sqrglssainq", model.value().get(0).tags().get("yqduujit").get(0)); - Assertions.assertEquals("yip", model.nextLink()); + Assertions.assertEquals("dng", model.value().get(0).displayName()); + Assertions.assertEquals("piu", model.value().get(0).description()); + Assertions.assertEquals("gygev", model.value().get(0).body()); + Assertions.assertEquals("yp", model.value().get(0).related().categories().get(0)); + Assertions.assertEquals("ydnfyhxdeoejz", model.value().get(0).related().resourceTypes().get(0)); + Assertions.assertEquals("ifsjttgzfbishcb", model.value().get(0).related().solutions().get(0)); + Assertions.assertEquals("deyeamdphagalpbu", model.value().get(0).tags().get("kix").get(0)); + Assertions.assertEquals("civfsnkymuctq", model.nextLink()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryListResult model - = new LogAnalyticsQueryPackQueryListResult() - .withValue( - Arrays - .asList( - new LogAnalyticsQueryPackQueryInner().withDisplayName("po") - .withDescription("heotusiv") - .withBody("evcciqihnhun") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() - .withCategories(Arrays.asList("zrnf", "gxg")) - .withResourceTypes( - Arrays.asList("emv", "zfkufubljofx", "eofjaeqjh", "jbasvmsmjqulngs")) - .withSolutions(Arrays.asList("bybkzgcwrwclxx", "rljdouskcqv", "ocrcjdk", "tnhxbn"))) - .withTags(mapOf("yqduujit", Arrays.asList("sqrglssainq", "jwnzlljfmp", "eebvmgxsab"), - "nhutjeltmrldhugj", Arrays.asList("czdzev", "dhkrwpdappdsbdk", "wrwjfeu"))) - .withProperties("datadatqxhocdgeabl"), - new LogAnalyticsQueryPackQueryInner().withDisplayName("asy") - .withDescription("ejk") - .withBody("tynqgoul") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() - .withCategories(Arrays.asList("i", "wyqkgfgibm", "dgak")) - .withResourceTypes(Arrays.asList("rxybz")) - .withSolutions(Arrays.asList("dqytbciqfouflmm"))) - .withTags(mapOf("spwgcuertumkdosv", Arrays.asList("modmglougpb", "wtmutduq", "ta"))) - .withProperties("datahbmdgbbjfdd"), - new LogAnalyticsQueryPackQueryInner().withDisplayName("gjyjgzjaoyfhrtxi") - .withDescription("uvfqawrlyxwj") - .withBody("cpr") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() - .withCategories(Arrays.asList("xgjvtbv")) - .withResourceTypes(Arrays.asList("szdnr", "jq")) - .withSolutions(Arrays.asList("muouqfp", "wzwbnguitn", "uizga", "x"))) - .withTags(mapOf("idf", Arrays.asList("uckyf", "hr"), "pvkmijcmmxdcuf", - Arrays.asList("wdzuhtymwisd", "fthwxmnteiwa"), "dwzjeiach", - Arrays.asList("srp", "mzidnsezcxtb", "sgfyccsnew"), "pyqr", - Arrays.asList("osfln", "osfqpteehzzv"))) - .withProperties("dataz"))) - .withNextLink("yip"); + LogAnalyticsQueryPackQueryListResult model = new LogAnalyticsQueryPackQueryListResult() + .withValue(Arrays.asList(new LogAnalyticsQueryPackQueryInner().withDisplayName("dng") + .withDescription("piu") + .withBody("gygev") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("yp", "rbpizc", "r", "j")) + .withResourceTypes(Arrays.asList("ydnfyhxdeoejz")) + .withSolutions(Arrays.asList("ifsjttgzfbishcb"))) + .withTags(mapOf("kix", Arrays.asList("deyeamdphagalpbu", "wgipwhono", "kgshwa"), "ttmrywnuzoqf", + Arrays.asList("injep"), "oqqnwvlryav", Arrays.asList("yqzrnkcqvyxlw", "zlsico"), "szfkbe", + Arrays.asList("heun", "mqhgyxzkonocuk", "klyaxuconu"))) + .withProperties("dataewrmjmwvvjektc"))) + .withNextLink("civfsnkymuctq"); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryListResult.class); - Assertions.assertEquals("po", model.value().get(0).displayName()); - Assertions.assertEquals("heotusiv", model.value().get(0).description()); - Assertions.assertEquals("evcciqihnhun", model.value().get(0).body()); - Assertions.assertEquals("zrnf", model.value().get(0).related().categories().get(0)); - Assertions.assertEquals("emv", model.value().get(0).related().resourceTypes().get(0)); - Assertions.assertEquals("bybkzgcwrwclxx", model.value().get(0).related().solutions().get(0)); - Assertions.assertEquals("sqrglssainq", model.value().get(0).tags().get("yqduujit").get(0)); - Assertions.assertEquals("yip", model.nextLink()); + Assertions.assertEquals("dng", model.value().get(0).displayName()); + Assertions.assertEquals("piu", model.value().get(0).description()); + Assertions.assertEquals("gygev", model.value().get(0).body()); + Assertions.assertEquals("yp", model.value().get(0).related().categories().get(0)); + Assertions.assertEquals("ydnfyhxdeoejz", model.value().get(0).related().resourceTypes().get(0)); + Assertions.assertEquals("ifsjttgzfbishcb", model.value().get(0).related().solutions().get(0)); + Assertions.assertEquals("deyeamdphagalpbu", model.value().get(0).tags().get("kix").get(0)); + Assertions.assertEquals("civfsnkymuctq", model.nextLink()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java index 5f1816304495..394b262405ab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesRelatedTests.java @@ -13,22 +13,22 @@ public final class LogAnalyticsQueryPackQueryPropertiesRelatedTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQueryPropertiesRelated model = BinaryData.fromString( - "{\"categories\":[\"tthzrvqd\"],\"resourceTypes\":[\"hjybigehoqfbo\"],\"solutions\":[\"anyktzlcuiywg\",\"ywgndrv\",\"nhzgpphrcgyn\",\"ocpecfvmmco\"]}") + "{\"categories\":[\"yqupedeojnabckh\",\"mtxpsiebtfh\",\"pesapskrdqmhjj\",\"htldwk\"],\"resourceTypes\":[\"uutkncw\",\"cwsvlxotog\",\"wrupqsxvnmicykvc\",\"o\"],\"solutions\":[\"lo\",\"notyfjfcnjbkcn\"]}") .toObject(LogAnalyticsQueryPackQueryPropertiesRelated.class); - Assertions.assertEquals("tthzrvqd", model.categories().get(0)); - Assertions.assertEquals("hjybigehoqfbo", model.resourceTypes().get(0)); - Assertions.assertEquals("anyktzlcuiywg", model.solutions().get(0)); + Assertions.assertEquals("yqupedeojnabckh", model.categories().get(0)); + Assertions.assertEquals("uutkncw", model.resourceTypes().get(0)); + Assertions.assertEquals("lo", model.solutions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryPropertiesRelated model - = new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("tthzrvqd")) - .withResourceTypes(Arrays.asList("hjybigehoqfbo")) - .withSolutions(Arrays.asList("anyktzlcuiywg", "ywgndrv", "nhzgpphrcgyn", "ocpecfvmmco")); + LogAnalyticsQueryPackQueryPropertiesRelated model = new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("yqupedeojnabckh", "mtxpsiebtfh", "pesapskrdqmhjj", "htldwk")) + .withResourceTypes(Arrays.asList("uutkncw", "cwsvlxotog", "wrupqsxvnmicykvc", "o")) + .withSolutions(Arrays.asList("lo", "notyfjfcnjbkcn")); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryPropertiesRelated.class); - Assertions.assertEquals("tthzrvqd", model.categories().get(0)); - Assertions.assertEquals("hjybigehoqfbo", model.resourceTypes().get(0)); - Assertions.assertEquals("anyktzlcuiywg", model.solutions().get(0)); + Assertions.assertEquals("yqupedeojnabckh", model.categories().get(0)); + Assertions.assertEquals("uutkncw", model.resourceTypes().get(0)); + Assertions.assertEquals("lo", model.solutions().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java index be3ea54f5034..a2042415c0c5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQueryPropertiesTests.java @@ -16,37 +16,37 @@ public final class LogAnalyticsQueryPackQueryPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQueryProperties model = BinaryData.fromString( - "{\"id\":\"s\",\"displayName\":\"sycbkbfk\",\"timeCreated\":\"2021-04-13T09:52:22Z\",\"timeModified\":\"2021-02-11T20:09:09Z\",\"author\":\"xxppofm\",\"description\":\"x\",\"body\":\"fjpgddtocjjxhvp\",\"related\":{\"categories\":[\"xhdzxibqeojnx\"],\"resourceTypes\":[\"vddntwn\",\"eic\",\"twnpzaoqvuhrhcf\",\"cyddglmjthjqk\"],\"solutions\":[\"eicxmqciwqvhkhi\",\"uigdtopbobjog\",\"m\",\"w\"]},\"tags\":{\"gvdfgiotkftutq\":[\"uhrzayvvt\"]},\"properties\":\"datangxlefgugnxkrxdq\"}") + "{\"id\":\"rq\",\"displayName\":\"uedck\",\"timeCreated\":\"2021-02-12T19:04:46Z\",\"timeModified\":\"2021-04-30T21:59:13Z\",\"author\":\"xzfeyueaxibxuj\",\"description\":\"hqwa\",\"body\":\"muzyoxaepdk\",\"related\":{\"categories\":[\"cuxrhdwbavx\",\"niwdjsw\",\"tsdbpgn\"],\"resourceTypes\":[\"x\"],\"solutions\":[\"xbzpfzab\",\"lcuhxwtctyqiklb\",\"ovplw\"]},\"tags\":{\"svmkfssxquk\":[\"gy\",\"gu\"],\"zkd\":[\"plgmgsxnk\"],\"wzbaiue\":[\"lpvlopw\",\"yighxpk\"]},\"properties\":\"dataa\"}") .toObject(LogAnalyticsQueryPackQueryProperties.class); - Assertions.assertEquals("sycbkbfk", model.displayName()); - Assertions.assertEquals("x", model.description()); - Assertions.assertEquals("fjpgddtocjjxhvp", model.body()); - Assertions.assertEquals("xhdzxibqeojnx", model.related().categories().get(0)); - Assertions.assertEquals("vddntwn", model.related().resourceTypes().get(0)); - Assertions.assertEquals("eicxmqciwqvhkhi", model.related().solutions().get(0)); - Assertions.assertEquals("uhrzayvvt", model.tags().get("gvdfgiotkftutq").get(0)); + Assertions.assertEquals("uedck", model.displayName()); + Assertions.assertEquals("hqwa", model.description()); + Assertions.assertEquals("muzyoxaepdk", model.body()); + Assertions.assertEquals("cuxrhdwbavx", model.related().categories().get(0)); + Assertions.assertEquals("x", model.related().resourceTypes().get(0)); + Assertions.assertEquals("xbzpfzab", model.related().solutions().get(0)); + Assertions.assertEquals("gy", model.tags().get("svmkfssxquk").get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - LogAnalyticsQueryPackQueryProperties model - = new LogAnalyticsQueryPackQueryProperties().withDisplayName("sycbkbfk") - .withDescription("x") - .withBody("fjpgddtocjjxhvp") - .withRelated( - new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("xhdzxibqeojnx")) - .withResourceTypes(Arrays.asList("vddntwn", "eic", "twnpzaoqvuhrhcf", "cyddglmjthjqk")) - .withSolutions(Arrays.asList("eicxmqciwqvhkhi", "uigdtopbobjog", "m", "w"))) - .withTags(mapOf("gvdfgiotkftutq", Arrays.asList("uhrzayvvt"))) - .withProperties("datangxlefgugnxkrxdq"); + LogAnalyticsQueryPackQueryProperties model = new LogAnalyticsQueryPackQueryProperties().withDisplayName("uedck") + .withDescription("hqwa") + .withBody("muzyoxaepdk") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("cuxrhdwbavx", "niwdjsw", "tsdbpgn")) + .withResourceTypes(Arrays.asList("x")) + .withSolutions(Arrays.asList("xbzpfzab", "lcuhxwtctyqiklb", "ovplw"))) + .withTags(mapOf("svmkfssxquk", Arrays.asList("gy", "gu"), "zkd", Arrays.asList("plgmgsxnk"), "wzbaiue", + Arrays.asList("lpvlopw", "yighxpk"))) + .withProperties("dataa"); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQueryProperties.class); - Assertions.assertEquals("sycbkbfk", model.displayName()); - Assertions.assertEquals("x", model.description()); - Assertions.assertEquals("fjpgddtocjjxhvp", model.body()); - Assertions.assertEquals("xhdzxibqeojnx", model.related().categories().get(0)); - Assertions.assertEquals("vddntwn", model.related().resourceTypes().get(0)); - Assertions.assertEquals("eicxmqciwqvhkhi", model.related().solutions().get(0)); - Assertions.assertEquals("uhrzayvvt", model.tags().get("gvdfgiotkftutq").get(0)); + Assertions.assertEquals("uedck", model.displayName()); + Assertions.assertEquals("hqwa", model.description()); + Assertions.assertEquals("muzyoxaepdk", model.body()); + Assertions.assertEquals("cuxrhdwbavx", model.related().categories().get(0)); + Assertions.assertEquals("x", model.related().resourceTypes().get(0)); + Assertions.assertEquals("xbzpfzab", model.related().solutions().get(0)); + Assertions.assertEquals("gy", model.tags().get("svmkfssxquk").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java index c39cfaf402d7..9accebae05c9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests.java @@ -13,22 +13,22 @@ public final class LogAnalyticsQueryPackQuerySearchPropertiesRelatedTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQuerySearchPropertiesRelated model = BinaryData.fromString( - "{\"categories\":[\"owgujjugwdkcglhs\"],\"resourceTypes\":[\"jdyggdtji\"],\"solutions\":[\"kuofqweykhme\"]}") + "{\"categories\":[\"vt\"],\"resourceTypes\":[\"mqkrhahvljuahaqu\",\"c\",\"hmdua\"],\"solutions\":[\"xqpvfadmw\"]}") .toObject(LogAnalyticsQueryPackQuerySearchPropertiesRelated.class); - Assertions.assertEquals("owgujjugwdkcglhs", model.categories().get(0)); - Assertions.assertEquals("jdyggdtji", model.resourceTypes().get(0)); - Assertions.assertEquals("kuofqweykhme", model.solutions().get(0)); + Assertions.assertEquals("vt", model.categories().get(0)); + Assertions.assertEquals("mqkrhahvljuahaqu", model.resourceTypes().get(0)); + Assertions.assertEquals("xqpvfadmw", model.solutions().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LogAnalyticsQueryPackQuerySearchPropertiesRelated model - = new LogAnalyticsQueryPackQuerySearchPropertiesRelated().withCategories(Arrays.asList("owgujjugwdkcglhs")) - .withResourceTypes(Arrays.asList("jdyggdtji")) - .withSolutions(Arrays.asList("kuofqweykhme")); + = new LogAnalyticsQueryPackQuerySearchPropertiesRelated().withCategories(Arrays.asList("vt")) + .withResourceTypes(Arrays.asList("mqkrhahvljuahaqu", "c", "hmdua")) + .withSolutions(Arrays.asList("xqpvfadmw")); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQuerySearchPropertiesRelated.class); - Assertions.assertEquals("owgujjugwdkcglhs", model.categories().get(0)); - Assertions.assertEquals("jdyggdtji", model.resourceTypes().get(0)); - Assertions.assertEquals("kuofqweykhme", model.solutions().get(0)); + Assertions.assertEquals("vt", model.categories().get(0)); + Assertions.assertEquals("mqkrhahvljuahaqu", model.resourceTypes().get(0)); + Assertions.assertEquals("xqpvfadmw", model.solutions().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java index 71d88a2658ff..75150951e370 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/LogAnalyticsQueryPackQuerySearchPropertiesTests.java @@ -16,29 +16,29 @@ public final class LogAnalyticsQueryPackQuerySearchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { LogAnalyticsQueryPackQuerySearchProperties model = BinaryData.fromString( - "{\"related\":{\"categories\":[\"c\",\"wnfnbacf\",\"onlebxetqgtzxdpn\",\"bqqwxrj\"],\"resourceTypes\":[\"llnwsubi\"],\"solutions\":[\"ampmngnz\",\"c\",\"aqw\",\"ochcbonqvpkvl\"]},\"tags\":{\"enjbdlwtgrhp\":[\"ea\",\"eipheoflokeyy\"],\"masxazjpqyegu\":[\"pj\"],\"cftadeh\":[\"hb\",\"xhejjzzvdud\",\"wdslfhotwmcy\",\"pwlbjnpg\"],\"xdn\":[\"ltyfsop\",\"usue\",\"nzwdejba\",\"orxzdmohctbqvud\"]}}") + "{\"related\":{\"categories\":[\"ttkphywpnvjtoqne\"],\"resourceTypes\":[\"lfplp\"],\"solutions\":[\"uscrpabgyepsb\"]},\"tags\":{\"kqujidsuyono\":[\"qugxywpmueefjzwf\"],\"wfudwpzntxhdzhl\":[\"laocqxtccmg\",\"udxytlmoyrx\"],\"sbkyvpycanuzbp\":[\"jbhckfrlhr\"],\"mx\":[\"afkuwb\",\"rnwb\",\"ehhseyvjusrts\",\"hspkdeemao\"]}}") .toObject(LogAnalyticsQueryPackQuerySearchProperties.class); - Assertions.assertEquals("c", model.related().categories().get(0)); - Assertions.assertEquals("llnwsubi", model.related().resourceTypes().get(0)); - Assertions.assertEquals("ampmngnz", model.related().solutions().get(0)); - Assertions.assertEquals("ea", model.tags().get("enjbdlwtgrhp").get(0)); + Assertions.assertEquals("ttkphywpnvjtoqne", model.related().categories().get(0)); + Assertions.assertEquals("lfplp", model.related().resourceTypes().get(0)); + Assertions.assertEquals("uscrpabgyepsb", model.related().solutions().get(0)); + Assertions.assertEquals("qugxywpmueefjzwf", model.tags().get("kqujidsuyono").get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { LogAnalyticsQueryPackQuerySearchProperties model = new LogAnalyticsQueryPackQuerySearchProperties() .withRelated(new LogAnalyticsQueryPackQuerySearchPropertiesRelated() - .withCategories(Arrays.asList("c", "wnfnbacf", "onlebxetqgtzxdpn", "bqqwxrj")) - .withResourceTypes(Arrays.asList("llnwsubi")) - .withSolutions(Arrays.asList("ampmngnz", "c", "aqw", "ochcbonqvpkvl"))) - .withTags(mapOf("enjbdlwtgrhp", Arrays.asList("ea", "eipheoflokeyy"), "masxazjpqyegu", Arrays.asList("pj"), - "cftadeh", Arrays.asList("hb", "xhejjzzvdud", "wdslfhotwmcy", "pwlbjnpg"), "xdn", - Arrays.asList("ltyfsop", "usue", "nzwdejba", "orxzdmohctbqvud"))); + .withCategories(Arrays.asList("ttkphywpnvjtoqne")) + .withResourceTypes(Arrays.asList("lfplp")) + .withSolutions(Arrays.asList("uscrpabgyepsb"))) + .withTags(mapOf("kqujidsuyono", Arrays.asList("qugxywpmueefjzwf"), "wfudwpzntxhdzhl", + Arrays.asList("laocqxtccmg", "udxytlmoyrx"), "sbkyvpycanuzbp", Arrays.asList("jbhckfrlhr"), "mx", + Arrays.asList("afkuwb", "rnwb", "ehhseyvjusrts", "hspkdeemao"))); model = BinaryData.fromObject(model).toObject(LogAnalyticsQueryPackQuerySearchProperties.class); - Assertions.assertEquals("c", model.related().categories().get(0)); - Assertions.assertEquals("llnwsubi", model.related().resourceTypes().get(0)); - Assertions.assertEquals("ampmngnz", model.related().solutions().get(0)); - Assertions.assertEquals("ea", model.tags().get("enjbdlwtgrhp").get(0)); + Assertions.assertEquals("ttkphywpnvjtoqne", model.related().categories().get(0)); + Assertions.assertEquals("lfplp", model.related().resourceTypes().get(0)); + Assertions.assertEquals("uscrpabgyepsb", model.related().solutions().get(0)); + Assertions.assertEquals("qugxywpmueefjzwf", model.tags().get("kqujidsuyono").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java index 1120c66992dd..0d55022b9927 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagedServiceIdentityTests.java @@ -16,7 +16,7 @@ public final class ManagedServiceIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"be80a829-4e64-42e8-8144-39a2107e6f7c\",\"tenantId\":\"b2f99afe-ea18-409c-8c3e-b8c6b30c667e\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"y\":{\"principalId\":\"c2094247-fc23-44d9-b2fb-e5752b134ff0\",\"clientId\":\"4d837673-32af-4936-b1b8-c1678c46ffd8\"},\"atdooaojkniod\":{\"principalId\":\"a4d2535b-4098-4a09-b1e0-60b30476302d\",\"clientId\":\"07b997ea-ecde-461d-a172-5a10933b8c37\"}}}") + "{\"principalId\":\"f80856e4-8dd6-4dcb-a8e6-9e199e7016b5\",\"tenantId\":\"50c95719-87cb-4144-a84e-fead5df80792\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"f\":{\"principalId\":\"6b97a81c-8a15-43bb-980b-543e3276cc55\",\"clientId\":\"87125785-d13b-4908-bbb7-f7be7e48f54c\"},\"rvktsi\":{\"principalId\":\"31ca72c9-7606-4d97-bce6-ed7144757fe3\",\"clientId\":\"dfab8ca2-46b9-43d2-a899-9e1ad2f128e9\"},\"ocipaouajpsqucm\":{\"principalId\":\"9e6a81ea-e769-4d67-a5a0-184e9029ac3a\",\"clientId\":\"f749d11d-d88e-464b-9e82-1fa51f02e65f\"}}}") .toObject(ManagedServiceIdentity.class); Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); } @@ -24,8 +24,8 @@ public void testDeserialize() throws Exception { @org.junit.jupiter.api.Test public void testSerialize() throws Exception { ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf("y", new UserAssignedIdentity(), "atdooaojkniod", new UserAssignedIdentity())); + .withUserAssignedIdentities(mapOf("f", new UserAssignedIdentity(), "rvktsi", new UserAssignedIdentity(), + "ocipaouajpsqucm", new UserAssignedIdentity())); model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.type()); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java index 64509598976a..1bebfb74bd7f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupInnerTests.java @@ -13,36 +13,36 @@ public final class ManagementGroupInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagementGroupInner model = BinaryData.fromString( - "{\"properties\":{\"serverCount\":903805755,\"isGateway\":true,\"name\":\"y\",\"id\":\"klwndnhjdauwhv\",\"created\":\"2021-04-27T11:03:59Z\",\"dataReceived\":\"2021-08-28T16:11:31Z\",\"version\":\"dhxujznbmpo\",\"sku\":\"wpr\"}}") + "{\"properties\":{\"serverCount\":2031463120,\"isGateway\":true,\"name\":\"jpkcattpng\",\"id\":\"rcczsqpjhvmd\",\"created\":\"2021-11-26T10:49:59Z\",\"dataReceived\":\"2021-07-30T15:20:57Z\",\"version\":\"ounqecano\",\"sku\":\"upfh\"}}") .toObject(ManagementGroupInner.class); - Assertions.assertEquals(903805755, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("y", model.name()); - Assertions.assertEquals("klwndnhjdauwhv", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T11:03:59Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T16:11:31Z"), model.dataReceived()); - Assertions.assertEquals("dhxujznbmpo", model.version()); - Assertions.assertEquals("wpr", model.sku()); + Assertions.assertEquals(2031463120, model.serverCount()); + Assertions.assertTrue(model.isGateway()); + Assertions.assertEquals("jpkcattpng", model.name()); + Assertions.assertEquals("rcczsqpjhvmd", model.id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T10:49:59Z"), model.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T15:20:57Z"), model.dataReceived()); + Assertions.assertEquals("ounqecano", model.version()); + Assertions.assertEquals("upfh", model.sku()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagementGroupInner model = new ManagementGroupInner().withServerCount(903805755) + ManagementGroupInner model = new ManagementGroupInner().withServerCount(2031463120) .withIsGateway(true) - .withName("y") - .withId("klwndnhjdauwhv") - .withCreated(OffsetDateTime.parse("2021-04-27T11:03:59Z")) - .withDataReceived(OffsetDateTime.parse("2021-08-28T16:11:31Z")) - .withVersion("dhxujznbmpo") - .withSku("wpr"); + .withName("jpkcattpng") + .withId("rcczsqpjhvmd") + .withCreated(OffsetDateTime.parse("2021-11-26T10:49:59Z")) + .withDataReceived(OffsetDateTime.parse("2021-07-30T15:20:57Z")) + .withVersion("ounqecano") + .withSku("upfh"); model = BinaryData.fromObject(model).toObject(ManagementGroupInner.class); - Assertions.assertEquals(903805755, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("y", model.name()); - Assertions.assertEquals("klwndnhjdauwhv", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-27T11:03:59Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-28T16:11:31Z"), model.dataReceived()); - Assertions.assertEquals("dhxujznbmpo", model.version()); - Assertions.assertEquals("wpr", model.sku()); + Assertions.assertEquals(2031463120, model.serverCount()); + Assertions.assertTrue(model.isGateway()); + Assertions.assertEquals("jpkcattpng", model.name()); + Assertions.assertEquals("rcczsqpjhvmd", model.id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T10:49:59Z"), model.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-30T15:20:57Z"), model.dataReceived()); + Assertions.assertEquals("ounqecano", model.version()); + Assertions.assertEquals("upfh", model.sku()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java index a0b72ac3c800..9c56646abbb9 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupPropertiesTests.java @@ -13,36 +13,36 @@ public final class ManagementGroupPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ManagementGroupProperties model = BinaryData.fromString( - "{\"serverCount\":741975656,\"isGateway\":true,\"name\":\"alupjm\",\"id\":\"fxobbcsws\",\"created\":\"2021-04-25T18:58:37Z\",\"dataReceived\":\"2021-09-18T23:40:57Z\",\"version\":\"lrbpbewtghfgbl\",\"sku\":\"wxzvlvqhjkb\"}") + "{\"serverCount\":2101228547,\"isGateway\":false,\"name\":\"mopjmc\",\"id\":\"tuo\",\"created\":\"2021-09-23T02:42:43Z\",\"dataReceived\":\"2021-10-23T10:51:29Z\",\"version\":\"uaodsfcpk\",\"sku\":\"odpuozmyzydag\"}") .toObject(ManagementGroupProperties.class); - Assertions.assertEquals(741975656, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("alupjm", model.name()); - Assertions.assertEquals("fxobbcsws", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T18:58:37Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T23:40:57Z"), model.dataReceived()); - Assertions.assertEquals("lrbpbewtghfgbl", model.version()); - Assertions.assertEquals("wxzvlvqhjkb", model.sku()); + Assertions.assertEquals(2101228547, model.serverCount()); + Assertions.assertFalse(model.isGateway()); + Assertions.assertEquals("mopjmc", model.name()); + Assertions.assertEquals("tuo", model.id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T02:42:43Z"), model.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T10:51:29Z"), model.dataReceived()); + Assertions.assertEquals("uaodsfcpk", model.version()); + Assertions.assertEquals("odpuozmyzydag", model.sku()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - ManagementGroupProperties model = new ManagementGroupProperties().withServerCount(741975656) - .withIsGateway(true) - .withName("alupjm") - .withId("fxobbcsws") - .withCreated(OffsetDateTime.parse("2021-04-25T18:58:37Z")) - .withDataReceived(OffsetDateTime.parse("2021-09-18T23:40:57Z")) - .withVersion("lrbpbewtghfgbl") - .withSku("wxzvlvqhjkb"); + ManagementGroupProperties model = new ManagementGroupProperties().withServerCount(2101228547) + .withIsGateway(false) + .withName("mopjmc") + .withId("tuo") + .withCreated(OffsetDateTime.parse("2021-09-23T02:42:43Z")) + .withDataReceived(OffsetDateTime.parse("2021-10-23T10:51:29Z")) + .withVersion("uaodsfcpk") + .withSku("odpuozmyzydag"); model = BinaryData.fromObject(model).toObject(ManagementGroupProperties.class); - Assertions.assertEquals(741975656, model.serverCount()); - Assertions.assertEquals(true, model.isGateway()); - Assertions.assertEquals("alupjm", model.name()); - Assertions.assertEquals("fxobbcsws", model.id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-25T18:58:37Z"), model.created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T23:40:57Z"), model.dataReceived()); - Assertions.assertEquals("lrbpbewtghfgbl", model.version()); - Assertions.assertEquals("wxzvlvqhjkb", model.sku()); + Assertions.assertEquals(2101228547, model.serverCount()); + Assertions.assertFalse(model.isGateway()); + Assertions.assertEquals("mopjmc", model.name()); + Assertions.assertEquals("tuo", model.id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-23T02:42:43Z"), model.created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T10:51:29Z"), model.dataReceived()); + Assertions.assertEquals("uaodsfcpk", model.version()); + Assertions.assertEquals("odpuozmyzydag", model.sku()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java index accd55f70333..93bc4c379260 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ManagementGroupsListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.ManagementGroup; @@ -22,26 +22,26 @@ public final class ManagementGroupsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"serverCount\":1980561633,\"isGateway\":false,\"name\":\"tcjuahokqto\",\"id\":\"auxofshfph\",\"created\":\"2021-08-16T03:23:29Z\",\"dataReceived\":\"2021-07-09T19:35:04Z\",\"version\":\"iywzejy\",\"sku\":\"slwkojpl\"}}]}"; + = "{\"value\":[{\"properties\":{\"serverCount\":2014474860,\"isGateway\":true,\"name\":\"vnqvcd\",\"id\":\"uaucmf\",\"created\":\"2021-12-08T13:34:35Z\",\"dataReceived\":\"2021-10-13T05:52:15Z\",\"version\":\"xpunjqi\",\"sku\":\"zvvitacgxmfcs\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.managementGroups().list("taboidvmf", "hppubowsepdfgkmt", com.azure.core.util.Context.NONE); + = manager.managementGroups().list("yjqtt", "wkpqhjpenuygbq", com.azure.core.util.Context.NONE); - Assertions.assertEquals(1980561633, response.iterator().next().serverCount()); - Assertions.assertEquals(false, response.iterator().next().isGateway()); - Assertions.assertEquals("tcjuahokqto", response.iterator().next().name()); - Assertions.assertEquals("auxofshfph", response.iterator().next().id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-16T03:23:29Z"), response.iterator().next().created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-09T19:35:04Z"), + Assertions.assertEquals(2014474860, response.iterator().next().serverCount()); + Assertions.assertTrue(response.iterator().next().isGateway()); + Assertions.assertEquals("vnqvcd", response.iterator().next().name()); + Assertions.assertEquals("uaucmf", response.iterator().next().id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-08T13:34:35Z"), response.iterator().next().created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-13T05:52:15Z"), response.iterator().next().dataReceived()); - Assertions.assertEquals("iywzejy", response.iterator().next().version()); - Assertions.assertEquals("slwkojpl", response.iterator().next().sku()); + Assertions.assertEquals("xpunjqi", response.iterator().next().version()); + Assertions.assertEquals("zvvitacgxmfcs", response.iterator().next().sku()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java index ba8915de7029..0fee218fc5bb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/MetricNameTests.java @@ -11,17 +11,17 @@ public final class MetricNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - MetricName model = BinaryData.fromString("{\"value\":\"gdtpnapnyiro\",\"localizedValue\":\"hpigv\"}") + MetricName model = BinaryData.fromString("{\"value\":\"emdwzrmuhapfc\",\"localizedValue\":\"psqxq\"}") .toObject(MetricName.class); - Assertions.assertEquals("gdtpnapnyiro", model.value()); - Assertions.assertEquals("hpigv", model.localizedValue()); + Assertions.assertEquals("emdwzrmuhapfc", model.value()); + Assertions.assertEquals("psqxq", model.localizedValue()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - MetricName model = new MetricName().withValue("gdtpnapnyiro").withLocalizedValue("hpigv"); + MetricName model = new MetricName().withValue("emdwzrmuhapfc").withLocalizedValue("psqxq"); model = BinaryData.fromObject(model).toObject(MetricName.class); - Assertions.assertEquals("gdtpnapnyiro", model.value()); - Assertions.assertEquals("hpigv", model.localizedValue()); + Assertions.assertEquals("emdwzrmuhapfc", model.value()); + Assertions.assertEquals("psqxq", model.localizedValue()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationInnerTests.java new file mode 100644 index 000000000000..67d4c726b26b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationInnerTests.java @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityProfile; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociation; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterConfigurationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeterConfigurationInner model = BinaryData.fromString( + "{\"properties\":{\"provisioningState\":\"Failed\",\"provisioningIssues\":[{\"name\":\"iglaecx\",\"properties\":{\"issueType\":\"ConfigurationPropagationFailure\",\"severity\":\"Warning\",\"description\":\"pvz\",\"suggestedResourceIds\":[\"t\",\"ld\"],\"suggestedAccessRules\":[{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"irclnpk\",\"perimeterGuid\":\"fd6fe512-283f-438e-a8dc-e4e919074990\",\"location\":\"yzriykhy\"},\"resourceAssociation\":{\"name\":\"vjlboxqvk\",\"accessMode\":\"Enforced\"},\"profile\":{\"name\":\"omdynhdwdigum\",\"accessRulesVersion\":1924046982,\"accessRules\":[{\"name\":\"zzp\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"dz\",\"ezwwv\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"fonkphhqyikvyla\",\"yavluwmncstt\",\"jfybvpoekrsgsgb\",\"huzqgn\"],\"emailAddresses\":[\"kynscliqhzv\",\"xnkomtkubo\",\"ppnvdxz\"],\"phoneNumbers\":[\"hfrbbc\",\"vqagtltdhlf\",\"qojpy\"]}},{\"name\":\"gtrd\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"zsdymbrnysuxmpra\",\"wgck\"],\"subscriptions\":[{},{},{},{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"ffwafq\",\"oudaspavehhrvk\",\"unzo\",\"ud\"],\"emailAddresses\":[\"gkmoyxcdyuibhmfd\"],\"phoneNumbers\":[\"ydvfvfcjnae\",\"isrvhm\"]}},{\"name\":\"r\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"cvwmzhwplefa\",\"vxilcbt\",\"nhnzeyqxt\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"hycav\",\"dggxdbeesmi\",\"knlrariaawiuagy\",\"wqfbylyrfgiagt\"],\"emailAddresses\":[\"ocqwogfnzjvus\",\"zldmozuxy\",\"fsbtkad\",\"ysownbtgkbug\"],\"phoneNumbers\":[\"cto\",\"cmisofie\",\"pe\"]}}],\"diagnosticSettingsVersion\":419692653,\"enabledLogCategories\":[\"dh\",\"u\"]}},\"id\":\"cp\",\"name\":\"cwkhihi\",\"type\":\"lhzdsqtzb\"}") + .toObject(NetworkSecurityPerimeterConfigurationInner.class); + Assertions.assertEquals("irclnpk", model.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("fd6fe512-283f-438e-a8dc-e4e919074990"), + model.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("yzriykhy", model.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("vjlboxqvk", model.properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, + model.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("omdynhdwdigum", model.properties().profile().name()); + Assertions.assertEquals(1924046982, model.properties().profile().accessRulesVersion()); + Assertions.assertEquals("zzp", model.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, + model.properties().profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("dz", + model.properties().profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("fonkphhqyikvyla", + model.properties().profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("kynscliqhzv", + model.properties().profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("hfrbbc", + model.properties().profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(419692653, model.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("dh", model.properties().profile().enabledLogCategories().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityPerimeterConfigurationInner model = new NetworkSecurityPerimeterConfigurationInner() + .withProperties(new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("irclnpk") + .withPerimeterGuid(UUID.fromString("fd6fe512-283f-438e-a8dc-e4e919074990")) + .withLocation("yzriykhy")) + .withResourceAssociation(new ResourceAssociation().withName("vjlboxqvk") + .withAccessMode(ResourceAssociationAccessMode.ENFORCED)) + .withProfile(new NetworkSecurityProfile().withName("omdynhdwdigum") + .withAccessRulesVersion(1924046982) + .withAccessRules(Arrays.asList( + new AccessRule().withName("zzp") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.INBOUND) + .withAddressPrefixes(Arrays.asList("dz", "ezwwv")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters( + Arrays.asList(new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames( + Arrays.asList("fonkphhqyikvyla", "yavluwmncstt", "jfybvpoekrsgsgb", "huzqgn")) + .withEmailAddresses(Arrays.asList("kynscliqhzv", "xnkomtkubo", "ppnvdxz")) + .withPhoneNumbers(Arrays.asList("hfrbbc", "vqagtltdhlf", "qojpy"))), + new AccessRule().withName("gtrd") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("zsdymbrnysuxmpra", "wgck")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames(Arrays.asList("ffwafq", "oudaspavehhrvk", "unzo", "ud")) + .withEmailAddresses(Arrays.asList("gkmoyxcdyuibhmfd")) + .withPhoneNumbers(Arrays.asList("ydvfvfcjnae", "isrvhm"))), + new AccessRule().withName("r") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("cvwmzhwplefa", "vxilcbt", "nhnzeyqxt")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), + new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames( + Arrays.asList("hycav", "dggxdbeesmi", "knlrariaawiuagy", "wqfbylyrfgiagt")) + .withEmailAddresses( + Arrays.asList("ocqwogfnzjvus", "zldmozuxy", "fsbtkad", "ysownbtgkbug")) + .withPhoneNumbers(Arrays.asList("cto", "cmisofie", "pe"))))) + .withDiagnosticSettingsVersion(419692653) + .withEnabledLogCategories(Arrays.asList("dh", "u")))); + model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationInner.class); + Assertions.assertEquals("irclnpk", model.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("fd6fe512-283f-438e-a8dc-e4e919074990"), + model.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("yzriykhy", model.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("vjlboxqvk", model.properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, + model.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("omdynhdwdigum", model.properties().profile().name()); + Assertions.assertEquals(1924046982, model.properties().profile().accessRulesVersion()); + Assertions.assertEquals("zzp", model.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, + model.properties().profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("dz", + model.properties().profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("fonkphhqyikvyla", + model.properties().profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("kynscliqhzv", + model.properties().profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("hfrbbc", + model.properties().profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(419692653, model.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("dh", model.properties().profile().enabledLogCategories().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationListResultTests.java new file mode 100644 index 000000000000..8f6c8ee1048d --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationListResultTests.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationListResult; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityProfile; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociation; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterConfigurationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeterConfigurationListResult model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"provisioningIssues\":[{\"name\":\"tcyohpfkyrk\",\"properties\":{}},{\"name\":\"giogsjkmnwqjno\",\"properties\":{}},{\"name\":\"yhddvia\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"n\",\"perimeterGuid\":\"2b8bcab4-d52c-4c6c-8613-5d5653a5376c\",\"location\":\"fpmvmemfnczd\"},\"resourceAssociation\":{\"name\":\"b\",\"accessMode\":\"Learning\"},\"profile\":{\"name\":\"lchpodbzevwrdn\",\"accessRulesVersion\":1073149595,\"accessRules\":[{}],\"diagnosticSettingsVersion\":1934709471,\"enabledLogCategories\":[\"swsmys\",\"uluqypfc\",\"lerchpq\"]}},\"id\":\"f\",\"name\":\"jbabwidf\",\"type\":\"xsspuunnoxyhk\"},{\"properties\":{\"provisioningState\":\"Updating\",\"provisioningIssues\":[{\"name\":\"hp\",\"properties\":{}},{\"name\":\"qcaaewdaomdjvl\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"kzbrmsgeivsiy\",\"perimeterGuid\":\"642c3ce5-05d9-4877-a0e0-b37d8749fb12\",\"location\":\"dncj\"},\"resourceAssociation\":{\"name\":\"nbzoggcu\",\"accessMode\":\"Audit\"},\"profile\":{\"name\":\"y\",\"accessRulesVersion\":1152319383,\"accessRules\":[{},{}],\"diagnosticSettingsVersion\":902332511,\"enabledLogCategories\":[\"pnylb\",\"uajlyj\"]}},\"id\":\"vofqzhvfc\",\"name\":\"byfmowuxr\",\"type\":\"jpvd\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"provisioningIssues\":[{\"name\":\"vwzjbhyz\",\"properties\":{}},{\"name\":\"rkambt\",\"properties\":{}},{\"name\":\"gvmnvuqeq\",\"properties\":{}},{\"name\":\"spastjbkkdmf\",\"properties\":{}}],\"networkSecurityPerimeter\":{\"id\":\"tmjlx\",\"perimeterGuid\":\"4aab6725-cbdf-4862-9d2c-0eb6e5ba1978\",\"location\":\"lozapeewchpxlk\"},\"resourceAssociation\":{\"name\":\"uziycsl\",\"accessMode\":\"Audit\"},\"profile\":{\"name\":\"ztcktyh\",\"accessRulesVersion\":400720959,\"accessRules\":[{},{}],\"diagnosticSettingsVersion\":1002446412,\"enabledLogCategories\":[\"lwmmrqzzrrjv\"]}},\"id\":\"lydzgk\",\"name\":\"vqeevtoep\",\"type\":\"yutnwytpzdmov\"}],\"nextLink\":\"fvaawzqa\"}") + .toObject(NetworkSecurityPerimeterConfigurationListResult.class); + Assertions.assertEquals("n", model.value().get(0).properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("2b8bcab4-d52c-4c6c-8613-5d5653a5376c"), + model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("fpmvmemfnczd", + model.value().get(0).properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("b", model.value().get(0).properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, + model.value().get(0).properties().resourceAssociation().accessMode()); + Assertions.assertEquals("lchpodbzevwrdn", model.value().get(0).properties().profile().name()); + Assertions.assertEquals(1073149595, model.value().get(0).properties().profile().accessRulesVersion()); + Assertions.assertEquals(1934709471, model.value().get(0).properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("swsmys", model.value().get(0).properties().profile().enabledLogCategories().get(0)); + Assertions.assertEquals("fvaawzqa", model.nextLink()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityPerimeterConfigurationListResult model + = new NetworkSecurityPerimeterConfigurationListResult() + .withValue( + Arrays + .asList( + new NetworkSecurityPerimeterConfigurationInner() + .withProperties( + new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("n") + .withPerimeterGuid(UUID.fromString("2b8bcab4-d52c-4c6c-8613-5d5653a5376c")) + .withLocation("fpmvmemfnczd")) + .withResourceAssociation(new ResourceAssociation().withName("b") + .withAccessMode(ResourceAssociationAccessMode.LEARNING)) + .withProfile( + new NetworkSecurityProfile().withName("lchpodbzevwrdn") + .withAccessRulesVersion(1073149595) + .withAccessRules(Arrays.asList(new AccessRule())) + .withDiagnosticSettingsVersion(1934709471) + .withEnabledLogCategories(Arrays.asList("swsmys", "uluqypfc", + "lerchpq")))), + new NetworkSecurityPerimeterConfigurationInner() + .withProperties(new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("kzbrmsgeivsiy") + .withPerimeterGuid(UUID.fromString("642c3ce5-05d9-4877-a0e0-b37d8749fb12")) + .withLocation("dncj")) + .withResourceAssociation(new ResourceAssociation().withName("nbzoggcu") + .withAccessMode(ResourceAssociationAccessMode.AUDIT)) + .withProfile(new NetworkSecurityProfile().withName("y") + .withAccessRulesVersion(1152319383) + .withAccessRules(Arrays.asList(new AccessRule(), new AccessRule())) + .withDiagnosticSettingsVersion(902332511) + .withEnabledLogCategories(Arrays.asList("pnylb", "uajlyj")))), + new NetworkSecurityPerimeterConfigurationInner() + .withProperties(new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("tmjlx") + .withPerimeterGuid(UUID.fromString("4aab6725-cbdf-4862-9d2c-0eb6e5ba1978")) + .withLocation("lozapeewchpxlk")) + .withResourceAssociation(new ResourceAssociation().withName("uziycsl") + .withAccessMode(ResourceAssociationAccessMode.AUDIT)) + .withProfile(new NetworkSecurityProfile().withName("ztcktyh") + .withAccessRulesVersion(400720959) + .withAccessRules(Arrays.asList(new AccessRule(), new AccessRule())) + .withDiagnosticSettingsVersion(1002446412) + .withEnabledLogCategories(Arrays.asList("lwmmrqzzrrjv")))))) + .withNextLink("fvaawzqa"); + model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationListResult.class); + Assertions.assertEquals("n", model.value().get(0).properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("2b8bcab4-d52c-4c6c-8613-5d5653a5376c"), + model.value().get(0).properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("fpmvmemfnczd", + model.value().get(0).properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("b", model.value().get(0).properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, + model.value().get(0).properties().resourceAssociation().accessMode()); + Assertions.assertEquals("lchpodbzevwrdn", model.value().get(0).properties().profile().name()); + Assertions.assertEquals(1073149595, model.value().get(0).properties().profile().accessRulesVersion()); + Assertions.assertEquals(1934709471, model.value().get(0).properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("swsmys", model.value().get(0).properties().profile().enabledLogCategories().get(0)); + Assertions.assertEquals("fvaawzqa", model.nextLink()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java new file mode 100644 index 000000000000..6560a84e4ac9 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterConfigurationPropertiesTests.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfigurationProperties; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityProfile; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociation; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterConfigurationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeterConfigurationProperties model = BinaryData.fromString( + "{\"provisioningState\":\"Canceled\",\"provisioningIssues\":[{\"name\":\"cjhfgmvecactxmw\",\"properties\":{\"issueType\":\"Unknown\",\"severity\":\"Error\",\"description\":\"luqovekqvg\",\"suggestedResourceIds\":[\"wifzmp\",\"wyivqikf\",\"cvhrfsp\"],\"suggestedAccessRules\":[{\"name\":\"rttikteusqc\",\"properties\":{}}]}}],\"networkSecurityPerimeter\":{\"id\":\"klxubyja\",\"perimeterGuid\":\"930005c2-8dba-4ead-93d7-e4d2e40bd7d2\",\"location\":\"mfblcqcuubg\"},\"resourceAssociation\":{\"name\":\"rtalmet\",\"accessMode\":\"Enforced\"},\"profile\":{\"name\":\"slqxi\",\"accessRulesVersion\":5802151,\"accessRules\":[{\"name\":\"i\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"xiutcx\",\"pzhyr\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"joxslhvnhla\",\"rqnkkzjcjbtr\"],\"emailAddresses\":[\"hvv\",\"brxjjsto\"],\"phoneNumbers\":[\"it\",\"kxzt\",\"oobklftidgfcwq\"]}},{\"name\":\"imaq\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"yhohujswtwkozzwc\",\"lkb\",\"wpfaj\",\"jwltlwtjjgu\"],\"subscriptions\":[{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"vkcdmxzr\",\"oaimlnw\",\"aaomylweazu\"],\"emailAddresses\":[\"ethwwnpjhlfz\",\"wpchwahf\"],\"phoneNumbers\":[\"snfepgfewetwlyx\",\"ncxykxhdjhlimm\",\"cxfhbcporxv\"]}},{\"name\":\"jzh\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"xtgqscjavftjuh\",\"qaz\",\"mtggu\"],\"subscriptions\":[{}],\"networkSecurityPerimeters\":[{}],\"fullyQualifiedDomainNames\":[\"civmmg\",\"f\"],\"emailAddresses\":[\"wrxgkneuvy\",\"nzqodfvpg\"],\"phoneNumbers\":[\"xgsg\",\"p\",\"gzdjtxvzf\",\"bqvgaqv\"]}}],\"diagnosticSettingsVersion\":247476852,\"enabledLogCategories\":[\"qusrdvetnws\",\"tutnwlduycvuzhyr\"]}}") + .toObject(NetworkSecurityPerimeterConfigurationProperties.class); + Assertions.assertEquals("klxubyja", model.networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("930005c2-8dba-4ead-93d7-e4d2e40bd7d2"), + model.networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("mfblcqcuubg", model.networkSecurityPerimeter().location()); + Assertions.assertEquals("rtalmet", model.resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, model.resourceAssociation().accessMode()); + Assertions.assertEquals("slqxi", model.profile().name()); + Assertions.assertEquals(5802151, model.profile().accessRulesVersion()); + Assertions.assertEquals("i", model.profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, + model.profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("xiutcx", model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("joxslhvnhla", + model.profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("hvv", model.profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("it", model.profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(247476852, model.profile().diagnosticSettingsVersion()); + Assertions.assertEquals("qusrdvetnws", model.profile().enabledLogCategories().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityPerimeterConfigurationProperties model = new NetworkSecurityPerimeterConfigurationProperties() + .withNetworkSecurityPerimeter(new NetworkSecurityPerimeter().withId("klxubyja") + .withPerimeterGuid(UUID.fromString("930005c2-8dba-4ead-93d7-e4d2e40bd7d2")) + .withLocation("mfblcqcuubg")) + .withResourceAssociation( + new ResourceAssociation().withName("rtalmet").withAccessMode(ResourceAssociationAccessMode.ENFORCED)) + .withProfile(new NetworkSecurityProfile().withName("slqxi") + .withAccessRulesVersion(5802151) + .withAccessRules(Arrays.asList( + new AccessRule().withName("i") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("xiutcx", "pzhyr")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames(Arrays.asList("joxslhvnhla", "rqnkkzjcjbtr")) + .withEmailAddresses(Arrays.asList("hvv", "brxjjsto")) + .withPhoneNumbers(Arrays.asList("it", "kxzt", "oobklftidgfcwq"))), + new AccessRule().withName("imaq") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.INBOUND) + .withAddressPrefixes(Arrays.asList("yhohujswtwkozzwc", "lkb", "wpfaj", "jwltlwtjjgu")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem(), + new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter(), + new NetworkSecurityPerimeter(), new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames(Arrays.asList("vkcdmxzr", "oaimlnw", "aaomylweazu")) + .withEmailAddresses(Arrays.asList("ethwwnpjhlfz", "wpchwahf")) + .withPhoneNumbers(Arrays.asList("snfepgfewetwlyx", "ncxykxhdjhlimm", "cxfhbcporxv"))), + new AccessRule().withName("jzh") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.OUTBOUND) + .withAddressPrefixes(Arrays.asList("xtgqscjavftjuh", "qaz", "mtggu")) + .withSubscriptions(Arrays.asList(new AccessRulePropertiesSubscriptionsItem())) + .withNetworkSecurityPerimeters(Arrays.asList(new NetworkSecurityPerimeter())) + .withFullyQualifiedDomainNames(Arrays.asList("civmmg", "f")) + .withEmailAddresses(Arrays.asList("wrxgkneuvy", "nzqodfvpg")) + .withPhoneNumbers(Arrays.asList("xgsg", "p", "gzdjtxvzf", "bqvgaqv"))))) + .withDiagnosticSettingsVersion(247476852) + .withEnabledLogCategories(Arrays.asList("qusrdvetnws", "tutnwlduycvuzhyr"))); + model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeterConfigurationProperties.class); + Assertions.assertEquals("klxubyja", model.networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("930005c2-8dba-4ead-93d7-e4d2e40bd7d2"), + model.networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("mfblcqcuubg", model.networkSecurityPerimeter().location()); + Assertions.assertEquals("rtalmet", model.resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, model.resourceAssociation().accessMode()); + Assertions.assertEquals("slqxi", model.profile().name()); + Assertions.assertEquals(5802151, model.profile().accessRulesVersion()); + Assertions.assertEquals("i", model.profile().accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.OUTBOUND, + model.profile().accessRules().get(0).properties().direction()); + Assertions.assertEquals("xiutcx", model.profile().accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("joxslhvnhla", + model.profile().accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("hvv", model.profile().accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("it", model.profile().accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(247476852, model.profile().diagnosticSettingsVersion()); + Assertions.assertEquals("qusrdvetnws", model.profile().enabledLogCategories().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterTests.java new file mode 100644 index 000000000000..b74ca6b42ac2 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityPerimeterTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityPerimeterTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityPerimeter model = BinaryData + .fromString( + "{\"id\":\"fdvruz\",\"perimeterGuid\":\"8a6215e5-b5c5-4c47-b2af-537d24ec44e7\",\"location\":\"ojhp\"}") + .toObject(NetworkSecurityPerimeter.class); + Assertions.assertEquals("fdvruz", model.id()); + Assertions.assertEquals(UUID.fromString("8a6215e5-b5c5-4c47-b2af-537d24ec44e7"), model.perimeterGuid()); + Assertions.assertEquals("ojhp", model.location()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityPerimeter model = new NetworkSecurityPerimeter().withId("fdvruz") + .withPerimeterGuid(UUID.fromString("8a6215e5-b5c5-4c47-b2af-537d24ec44e7")) + .withLocation("ojhp"); + model = BinaryData.fromObject(model).toObject(NetworkSecurityPerimeter.class); + Assertions.assertEquals("fdvruz", model.id()); + Assertions.assertEquals(UUID.fromString("8a6215e5-b5c5-4c47-b2af-537d24ec44e7"), model.perimeterGuid()); + Assertions.assertEquals("ojhp", model.location()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityProfileTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityProfileTests.java new file mode 100644 index 000000000000..2838b2ae81e1 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/NetworkSecurityProfileTests.java @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.AccessRule; +import com.azure.resourcemanager.loganalytics.models.AccessRuleDirection; +import com.azure.resourcemanager.loganalytics.models.AccessRuleProperties; +import com.azure.resourcemanager.loganalytics.models.AccessRulePropertiesSubscriptionsItem; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeter; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityProfile; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class NetworkSecurityProfileTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + NetworkSecurityProfile model = BinaryData.fromString( + "{\"name\":\"ugeyzihgrkyuiza\",\"accessRulesVersion\":1192399452,\"accessRules\":[{\"name\":\"phojeevyhy\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"zbgomfgbeg\",\"qgleohibetnluank\",\"rfxeeebtij\"],\"subscriptions\":[{\"id\":\"bmqzbqqxlajrnwx\"},{\"id\":\"evehjkuyxoaf\"}],\"networkSecurityPerimeters\":[{\"id\":\"lt\",\"perimeterGuid\":\"5eee6773-30c2-41ee-8777-049b1ca9b5ca\",\"location\":\"yl\"},{\"id\":\"mfgvxirpghriypo\",\"perimeterGuid\":\"cf775843-639b-4af3-9d9d-173c1d94e988\",\"location\":\"hlqhykprlpy\"}],\"fullyQualifiedDomainNames\":[\"ciqdsme\",\"iitdfuxt\"],\"emailAddresses\":[\"iibmi\",\"bnn\",\"stgnl\",\"hnmgixhcm\"],\"phoneNumbers\":[\"qfoudorhcgyy\",\"rotwypundmbxhugc\",\"jkavl\"]}},{\"name\":\"rb\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"tzfjltf\",\"nzcyjtotp\",\"opv\",\"bdb\"],\"subscriptions\":[{\"id\":\"q\"},{\"id\":\"edsvqwthmk\"},{\"id\":\"bcysih\"}],\"networkSecurityPerimeters\":[{\"id\":\"wdhohsdtmcdzsu\",\"perimeterGuid\":\"b8ed1dac-0f55-475e-b9a4-dc4a83a5ba76\",\"location\":\"hdxbzlm\"},{\"id\":\"uapcvhdbevwqqxe\",\"perimeterGuid\":\"693cdddf-6e03-4e37-84ce-6d575fe9460f\",\"location\":\"onqzinkfkbgbzbow\"}],\"fullyQualifiedDomainNames\":[\"o\"],\"emailAddresses\":[\"mygvkzqkj\",\"eokbze\"],\"phoneNumbers\":[\"rx\",\"czurtlei\",\"q\"]}}],\"diagnosticSettingsVersion\":796775151,\"enabledLogCategories\":[\"zgnzv\"]}") + .toObject(NetworkSecurityProfile.class); + Assertions.assertEquals("ugeyzihgrkyuiza", model.name()); + Assertions.assertEquals(1192399452, model.accessRulesVersion()); + Assertions.assertEquals("phojeevyhy", model.accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, model.accessRules().get(0).properties().direction()); + Assertions.assertEquals("zbgomfgbeg", model.accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("bmqzbqqxlajrnwx", model.accessRules().get(0).properties().subscriptions().get(0).id()); + Assertions.assertEquals("lt", model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("5eee6773-30c2-41ee-8777-049b1ca9b5ca"), + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("yl", + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("ciqdsme", model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("iibmi", model.accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("qfoudorhcgyy", model.accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(796775151, model.diagnosticSettingsVersion()); + Assertions.assertEquals("zgnzv", model.enabledLogCategories().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + NetworkSecurityProfile model + = new NetworkSecurityProfile().withName("ugeyzihgrkyuiza") + .withAccessRulesVersion(1192399452) + .withAccessRules( + Arrays + .asList( + new AccessRule().withName("phojeevyhy") + .withProperties(new AccessRuleProperties().withDirection(AccessRuleDirection.INBOUND) + .withAddressPrefixes(Arrays.asList("zbgomfgbeg", "qgleohibetnluank", "rfxeeebtij")) + .withSubscriptions(Arrays + .asList(new AccessRulePropertiesSubscriptionsItem().withId("bmqzbqqxlajrnwx"), + new AccessRulePropertiesSubscriptionsItem().withId("evehjkuyxoaf"))) + .withNetworkSecurityPerimeters( + Arrays.asList( + new NetworkSecurityPerimeter().withId("lt") + .withPerimeterGuid( + UUID.fromString("5eee6773-30c2-41ee-8777-049b1ca9b5ca")) + .withLocation("yl"), + new NetworkSecurityPerimeter().withId("mfgvxirpghriypo") + .withPerimeterGuid( + UUID.fromString("cf775843-639b-4af3-9d9d-173c1d94e988")) + .withLocation("hlqhykprlpy"))) + .withFullyQualifiedDomainNames(Arrays.asList("ciqdsme", "iitdfuxt")) + .withEmailAddresses(Arrays.asList("iibmi", "bnn", "stgnl", "hnmgixhcm")) + .withPhoneNumbers(Arrays.asList("qfoudorhcgyy", "rotwypundmbxhugc", "jkavl"))), + new AccessRule().withName("rb") + .withProperties( + new AccessRuleProperties().withDirection(AccessRuleDirection.INBOUND) + .withAddressPrefixes(Arrays.asList("tzfjltf", "nzcyjtotp", "opv", "bdb")) + .withSubscriptions( + Arrays.asList(new AccessRulePropertiesSubscriptionsItem().withId("q"), + new AccessRulePropertiesSubscriptionsItem().withId("edsvqwthmk"), + new AccessRulePropertiesSubscriptionsItem().withId("bcysih"))) + .withNetworkSecurityPerimeters(Arrays.asList( + new NetworkSecurityPerimeter().withId("wdhohsdtmcdzsu") + .withPerimeterGuid( + UUID.fromString("b8ed1dac-0f55-475e-b9a4-dc4a83a5ba76")) + .withLocation("hdxbzlm"), + new NetworkSecurityPerimeter().withId("uapcvhdbevwqqxe") + .withPerimeterGuid( + UUID.fromString("693cdddf-6e03-4e37-84ce-6d575fe9460f")) + .withLocation("onqzinkfkbgbzbow"))) + .withFullyQualifiedDomainNames(Arrays.asList("o")) + .withEmailAddresses(Arrays.asList("mygvkzqkj", "eokbze")) + .withPhoneNumbers(Arrays.asList("rx", "czurtlei", "q"))))) + .withDiagnosticSettingsVersion(796775151) + .withEnabledLogCategories(Arrays.asList("zgnzv")); + model = BinaryData.fromObject(model).toObject(NetworkSecurityProfile.class); + Assertions.assertEquals("ugeyzihgrkyuiza", model.name()); + Assertions.assertEquals(1192399452, model.accessRulesVersion()); + Assertions.assertEquals("phojeevyhy", model.accessRules().get(0).name()); + Assertions.assertEquals(AccessRuleDirection.INBOUND, model.accessRules().get(0).properties().direction()); + Assertions.assertEquals("zbgomfgbeg", model.accessRules().get(0).properties().addressPrefixes().get(0)); + Assertions.assertEquals("bmqzbqqxlajrnwx", model.accessRules().get(0).properties().subscriptions().get(0).id()); + Assertions.assertEquals("lt", model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).id()); + Assertions.assertEquals(UUID.fromString("5eee6773-30c2-41ee-8777-049b1ca9b5ca"), + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).perimeterGuid()); + Assertions.assertEquals("yl", + model.accessRules().get(0).properties().networkSecurityPerimeters().get(0).location()); + Assertions.assertEquals("ciqdsme", model.accessRules().get(0).properties().fullyQualifiedDomainNames().get(0)); + Assertions.assertEquals("iibmi", model.accessRules().get(0).properties().emailAddresses().get(0)); + Assertions.assertEquals("qfoudorhcgyy", model.accessRules().get(0).properties().phoneNumbers().get(0)); + Assertions.assertEquals(796775151, model.diagnosticSettingsVersion()); + Assertions.assertEquals("zgnzv", model.enabledLogCategories().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java index 658596d1c0f9..6f839b25fa58 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationDisplayTests.java @@ -12,24 +12,24 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"znqntoru\",\"resource\":\"gsahmkycgrauw\",\"operation\":\"etaebu\",\"description\":\"vdmovsmzlxwabm\"}") + "{\"provider\":\"ugidyjrr\",\"resource\":\"y\",\"operation\":\"svexcsonpclhoco\",\"description\":\"lkevle\"}") .toObject(OperationDisplay.class); - Assertions.assertEquals("znqntoru", model.provider()); - Assertions.assertEquals("gsahmkycgrauw", model.resource()); - Assertions.assertEquals("etaebu", model.operation()); - Assertions.assertEquals("vdmovsmzlxwabm", model.description()); + Assertions.assertEquals("ugidyjrr", model.provider()); + Assertions.assertEquals("y", model.resource()); + Assertions.assertEquals("svexcsonpclhoco", model.operation()); + Assertions.assertEquals("lkevle", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay().withProvider("znqntoru") - .withResource("gsahmkycgrauw") - .withOperation("etaebu") - .withDescription("vdmovsmzlxwabm"); + OperationDisplay model = new OperationDisplay().withProvider("ugidyjrr") + .withResource("y") + .withOperation("svexcsonpclhoco") + .withDescription("lkevle"); model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("znqntoru", model.provider()); - Assertions.assertEquals("gsahmkycgrauw", model.resource()); - Assertions.assertEquals("etaebu", model.operation()); - Assertions.assertEquals("vdmovsmzlxwabm", model.description()); + Assertions.assertEquals("ugidyjrr", model.provider()); + Assertions.assertEquals("y", model.resource()); + Assertions.assertEquals("svexcsonpclhoco", model.operation()); + Assertions.assertEquals("lkevle", model.description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java index 0c58020760f3..230330b39037 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationInnerTests.java @@ -13,27 +13,27 @@ public final class OperationInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationInner model = BinaryData.fromString( - "{\"name\":\"vxb\",\"display\":{\"provider\":\"udutnco\",\"resource\":\"r\",\"operation\":\"qtvcofudflvkgj\",\"description\":\"gdknnqv\"}}") + "{\"name\":\"sa\",\"display\":{\"provider\":\"ku\",\"resource\":\"oskg\",\"operation\":\"auu\",\"description\":\"jmvxie\"}}") .toObject(OperationInner.class); - Assertions.assertEquals("vxb", model.name()); - Assertions.assertEquals("udutnco", model.display().provider()); - Assertions.assertEquals("r", model.display().resource()); - Assertions.assertEquals("qtvcofudflvkgj", model.display().operation()); - Assertions.assertEquals("gdknnqv", model.display().description()); + Assertions.assertEquals("sa", model.name()); + Assertions.assertEquals("ku", model.display().provider()); + Assertions.assertEquals("oskg", model.display().resource()); + Assertions.assertEquals("auu", model.display().operation()); + Assertions.assertEquals("jmvxie", model.display().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withName("vxb") - .withDisplay(new OperationDisplay().withProvider("udutnco") - .withResource("r") - .withOperation("qtvcofudflvkgj") - .withDescription("gdknnqv")); + OperationInner model = new OperationInner().withName("sa") + .withDisplay(new OperationDisplay().withProvider("ku") + .withResource("oskg") + .withOperation("auu") + .withDescription("jmvxie")); model = BinaryData.fromObject(model).toObject(OperationInner.class); - Assertions.assertEquals("vxb", model.name()); - Assertions.assertEquals("udutnco", model.display().provider()); - Assertions.assertEquals("r", model.display().resource()); - Assertions.assertEquals("qtvcofudflvkgj", model.display().operation()); - Assertions.assertEquals("gdknnqv", model.display().description()); + Assertions.assertEquals("sa", model.name()); + Assertions.assertEquals("ku", model.display().provider()); + Assertions.assertEquals("oskg", model.display().resource()); + Assertions.assertEquals("auu", model.display().operation()); + Assertions.assertEquals("jmvxie", model.display().description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java index c98a9d19a474..3b474d738a34 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationListResultTests.java @@ -15,28 +15,38 @@ public final class OperationListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"xzfe\",\"display\":{\"provider\":\"ppriol\",\"resource\":\"rjaltolmncw\",\"operation\":\"bqwcsdbnwdcf\",\"description\":\"cqdpfuv\"}}],\"nextLink\":\"sbjjc\"}") + "{\"value\":[{\"name\":\"bezy\",\"display\":{\"provider\":\"kktwhrdxw\",\"resource\":\"wqsmbsur\",\"operation\":\"imoryocfsfksym\",\"description\":\"ys\"}},{\"name\":\"i\",\"display\":{\"provider\":\"hqyudxorrqnbpoc\",\"resource\":\"yifqrvkdvjsllrmv\",\"operation\":\"f\",\"description\":\"t\"}},{\"name\":\"n\",\"display\":{\"provider\":\"exxbczwtr\",\"resource\":\"iqzbq\",\"operation\":\"sovmyokacspkwl\",\"description\":\"dobpxjmflbvvn\"}}],\"nextLink\":\"rkcciwwzjuqk\"}") .toObject(OperationListResult.class); - Assertions.assertEquals("xzfe", model.value().get(0).name()); - Assertions.assertEquals("ppriol", model.value().get(0).display().provider()); - Assertions.assertEquals("rjaltolmncw", model.value().get(0).display().resource()); - Assertions.assertEquals("bqwcsdbnwdcf", model.value().get(0).display().operation()); - Assertions.assertEquals("cqdpfuv", model.value().get(0).display().description()); + Assertions.assertEquals("bezy", model.value().get(0).name()); + Assertions.assertEquals("kktwhrdxw", model.value().get(0).display().provider()); + Assertions.assertEquals("wqsmbsur", model.value().get(0).display().resource()); + Assertions.assertEquals("imoryocfsfksym", model.value().get(0).display().operation()); + Assertions.assertEquals("ys", model.value().get(0).display().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationListResult model - = new OperationListResult().withValue(Arrays.asList(new OperationInner().withName("xzfe") - .withDisplay(new OperationDisplay().withProvider("ppriol") - .withResource("rjaltolmncw") - .withOperation("bqwcsdbnwdcf") - .withDescription("cqdpfuv")))); + OperationListResult model = new OperationListResult().withValue(Arrays.asList( + new OperationInner().withName("bezy") + .withDisplay(new OperationDisplay().withProvider("kktwhrdxw") + .withResource("wqsmbsur") + .withOperation("imoryocfsfksym") + .withDescription("ys")), + new OperationInner().withName("i") + .withDisplay(new OperationDisplay().withProvider("hqyudxorrqnbpoc") + .withResource("yifqrvkdvjsllrmv") + .withOperation("f") + .withDescription("t")), + new OperationInner().withName("n") + .withDisplay(new OperationDisplay().withProvider("exxbczwtr") + .withResource("iqzbq") + .withOperation("sovmyokacspkwl") + .withDescription("dobpxjmflbvvn")))); model = BinaryData.fromObject(model).toObject(OperationListResult.class); - Assertions.assertEquals("xzfe", model.value().get(0).name()); - Assertions.assertEquals("ppriol", model.value().get(0).display().provider()); - Assertions.assertEquals("rjaltolmncw", model.value().get(0).display().resource()); - Assertions.assertEquals("bqwcsdbnwdcf", model.value().get(0).display().operation()); - Assertions.assertEquals("cqdpfuv", model.value().get(0).display().description()); + Assertions.assertEquals("bezy", model.value().get(0).name()); + Assertions.assertEquals("kktwhrdxw", model.value().get(0).display().provider()); + Assertions.assertEquals("wqsmbsur", model.value().get(0).display().resource()); + Assertions.assertEquals("imoryocfsfksym", model.value().get(0).display().operation()); + Assertions.assertEquals("ys", model.value().get(0).display().description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java index 3afabcdaf67d..5b44dd0d0ebd 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/OperationsListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.Operation; @@ -22,21 +22,21 @@ public final class OperationsListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":\"xkykxdssjp\",\"display\":{\"provider\":\"ucfx\",\"resource\":\"kkflrmymyincqlhr\",\"operation\":\"wslmiiiovgqcg\",\"description\":\"ugqkctotiowlxteq\"}}]}"; + = "{\"value\":[{\"name\":\"rxhtvso\",\"display\":{\"provider\":\"wntsjgqrsxy\",\"resource\":\"uuuybnchrsziz\",\"operation\":\"uelyetndn\",\"description\":\"qyggagfl\"}}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("xkykxdssjp", response.iterator().next().name()); - Assertions.assertEquals("ucfx", response.iterator().next().display().provider()); - Assertions.assertEquals("kkflrmymyincqlhr", response.iterator().next().display().resource()); - Assertions.assertEquals("wslmiiiovgqcg", response.iterator().next().display().operation()); - Assertions.assertEquals("ugqkctotiowlxteq", response.iterator().next().display().description()); + Assertions.assertEquals("rxhtvso", response.iterator().next().name()); + Assertions.assertEquals("wntsjgqrsxy", response.iterator().next().display().provider()); + Assertions.assertEquals("uuuybnchrsziz", response.iterator().next().display().resource()); + Assertions.assertEquals("uelyetndn", response.iterator().next().display().operation()); + Assertions.assertEquals("qyggagfl", response.iterator().next().display().description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java index 653f54965b40..25393ad99897 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/PrivateLinkScopedResourceTests.java @@ -11,19 +11,17 @@ public final class PrivateLinkScopedResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - PrivateLinkScopedResource model - = BinaryData.fromString("{\"resourceId\":\"iakp\",\"scopeId\":\"qqmtedltmmji\"}") - .toObject(PrivateLinkScopedResource.class); - Assertions.assertEquals("iakp", model.resourceId()); - Assertions.assertEquals("qqmtedltmmji", model.scopeId()); + PrivateLinkScopedResource model = BinaryData.fromString("{\"resourceId\":\"bar\",\"scopeId\":\"uayjkqa\"}") + .toObject(PrivateLinkScopedResource.class); + Assertions.assertEquals("bar", model.resourceId()); + Assertions.assertEquals("uayjkqa", model.scopeId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PrivateLinkScopedResource model - = new PrivateLinkScopedResource().withResourceId("iakp").withScopeId("qqmtedltmmji"); + PrivateLinkScopedResource model = new PrivateLinkScopedResource().withResourceId("bar").withScopeId("uayjkqa"); model = BinaryData.fromObject(model).toObject(PrivateLinkScopedResource.class); - Assertions.assertEquals("iakp", model.resourceId()); - Assertions.assertEquals("qqmtedltmmji", model.scopeId()); + Assertions.assertEquals("bar", model.resourceId()); + Assertions.assertEquals("uayjkqa", model.scopeId()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssuePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssuePropertiesTests.java new file mode 100644 index 000000000000..4b2e70bcacba --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssuePropertiesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.ProvisioningIssueProperties; + +public final class ProvisioningIssuePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProvisioningIssueProperties model = BinaryData.fromString( + "{\"issueType\":\"ConfigurationPropagationFailure\",\"severity\":\"Error\",\"description\":\"jjidjk\",\"suggestedResourceIds\":[\"kyxvxevblbjedn\",\"jlageu\",\"ulxunsmjbnkpp\"],\"suggestedAccessRules\":[{\"name\":\"nlsvxeiz\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"srmffeycxcktpiym\",\"rteeamm\",\"qiekkkzddrt\"],\"subscriptions\":[{\"id\":\"jbmxvavre\"}],\"networkSecurityPerimeters\":[{\"id\":\"svecuijpxtxs\",\"perimeterGuid\":\"0888ade7-9e97-44f3-8fbc-ef9fff7091c1\",\"location\":\"rtujwsawddjibab\"},{\"id\":\"ititvtzeexavoxt\",\"perimeterGuid\":\"26df57b3-697b-46c1-8941-74b61b18ab53\",\"location\":\"ecdmdqbwpy\"}],\"fullyQualifiedDomainNames\":[\"gsfjac\",\"slhhxudbxv\"],\"emailAddresses\":[\"tnsi\",\"ud\"],\"phoneNumbers\":[\"mes\"]}},{\"name\":\"dlpagzrcxfail\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"boxdfgsftufq\",\"brjlnacgcckknhxk\",\"zvytnrzvuljraaer\",\"nok\"],\"subscriptions\":[{\"id\":\"kjq\"},{\"id\":\"broyla\"},{\"id\":\"ulcdisdosf\"},{\"id\":\"jsvg\"}],\"networkSecurityPerimeters\":[{\"id\":\"r\",\"perimeterGuid\":\"13dd419b-9823-4900-aa2a-c60009cd5ec1\",\"location\":\"cytdclxgccknfnwm\"},{\"id\":\"mvpdvjdhttzaef\",\"perimeterGuid\":\"a4b28acc-03b0-4e92-ac44-cd4e8f0b6239\",\"location\":\"ihchrphkmcrjdqn\"},{\"id\":\"fzpbgtgkyl\",\"perimeterGuid\":\"5a821df0-0c09-4e66-8d59-28631b348153\",\"location\":\"hrjeuutlw\"}],\"fullyQualifiedDomainNames\":[\"w\"],\"emailAddresses\":[\"kvbwnhhtqlgeh\",\"ppipifhpfeoa\",\"vgcxtx\",\"csheafidltugsr\"],\"phoneNumbers\":[\"kssjhoiftxfk\"]}},{\"name\":\"egprhptil\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"tgdqohmcwsldriz\",\"tpwb\",\"a\"],\"subscriptions\":[{\"id\":\"bphbqzmizakakank\"},{\"id\":\"dnjzh\"}],\"networkSecurityPerimeters\":[{\"id\":\"lhjlmuoyxprimr\",\"perimeterGuid\":\"95824214-f380-4d87-8e47-7eda5ebf0d01\",\"location\":\"teecjmeislst\"},{\"id\":\"sylwxdzaumweooh\",\"perimeterGuid\":\"4c9c2db2-5c35-4e99-8707-41f3d277d557\",\"location\":\"fuzboyjathwtzolb\"},{\"id\":\"mwmdxmebwjscjpa\",\"perimeterGuid\":\"31022458-bd5a-429f-ab1c-d4678c2f0b95\",\"location\":\"veabfqxnmwmqtib\"},{\"id\":\"ijddtvqc\",\"perimeterGuid\":\"d60506fe-97b9-4011-8367-88d41369b09c\",\"location\":\"dija\"}],\"fullyQualifiedDomainNames\":[\"mrsieekp\"],\"emailAddresses\":[\"aapm\",\"dqmeqwigpibudq\",\"yxeb\",\"ybpmzznrtffyaq\"],\"phoneNumbers\":[\"hheioqaqhvseuf\"]}}]}") + .toObject(ProvisioningIssueProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProvisioningIssueProperties model = new ProvisioningIssueProperties(); + model = BinaryData.fromObject(model).toObject(ProvisioningIssueProperties.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssueTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssueTests.java new file mode 100644 index 000000000000..5dfb515c0292 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ProvisioningIssueTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.ProvisioningIssue; + +public final class ProvisioningIssueTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ProvisioningIssue model = BinaryData.fromString( + "{\"name\":\"wipmvekdxuk\",\"properties\":{\"issueType\":\"MissingIdentityConfiguration\",\"severity\":\"Error\",\"description\":\"undxgketw\",\"suggestedResourceIds\":[\"zjhfjmhvv\",\"uvgp\"],\"suggestedAccessRules\":[{\"name\":\"qsxvmhf\",\"properties\":{\"direction\":\"Outbound\",\"addressPrefixes\":[\"hsasbhu\",\"ypoh\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{},{}],\"fullyQualifiedDomainNames\":[\"nsqyrpfoobrltt\",\"msjnygqdnfw\",\"zdzgtilaxhnfhqly\"],\"emailAddresses\":[\"ouwivkxoyzunbixx\"],\"phoneNumbers\":[\"kvcpwpgclr\",\"ivtsoxfrkenxpm\"]}},{\"name\":\"efrp\",\"properties\":{\"direction\":\"Inbound\",\"addressPrefixes\":[\"skawaoqvmmb\",\"pqfrtqlkz\"],\"subscriptions\":[{},{},{}],\"networkSecurityPerimeters\":[{},{}],\"fullyQualifiedDomainNames\":[\"vkxlz\",\"qdrfegcealzxwhc\",\"nsymoyqhlwigd\"],\"emailAddresses\":[\"kbxgom\",\"ajuwas\",\"vdaeyyguxakjsq\"],\"phoneNumbers\":[\"bezkgimsidxasic\",\"dyvvjskgfmocwahp\",\"gat\",\"eaahhvjhhn\"]}}]}}") + .toObject(ProvisioningIssue.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ProvisioningIssue model = new ProvisioningIssue(); + model = BinaryData.fromObject(model).toObject(ProvisioningIssue.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java index 24e1bf1eae46..c9626f6d165d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.queries().deleteWithResponse("jdfqwmkyoqufdvr", "zslzojhp", "tfnmdx", com.azure.core.util.Context.NONE); + manager.queries() + .deleteWithResponse("yjucejikzoeo", "vtzejetjklnti", "yjuzkdb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java index 1eee646bd614..24a7a169654d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; @@ -21,25 +21,25 @@ public final class QueriesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"id\":\"woycqucwyha\",\"displayName\":\"nomdrkywuhpsv\",\"timeCreated\":\"2021-05-26T05:35:58Z\",\"timeModified\":\"2021-01-31T05:51:43Z\",\"author\":\"lwexxwl\",\"description\":\"niexzsrzpgepq\",\"body\":\"yb\",\"related\":{\"categories\":[\"gdakchz\",\"vl\",\"xqnrkcxk\"],\"resourceTypes\":[\"nxm\"],\"solutions\":[\"xs\",\"qrntv\",\"wijpsttexoqqpwc\"]},\"tags\":{\"ndy\":[\"mhruncuwm\",\"spkcdqzh\",\"ctddun\"],\"boxjumvq\":[\"chrqb\",\"jjrcgegydc\"]},\"properties\":\"datalihrraiouaubr\"},\"id\":\"loqxfuojrngif\",\"name\":\"z\",\"type\":\"sccbiuimzd\"}"; + = "{\"properties\":{\"id\":\"rtws\",\"displayName\":\"hv\",\"timeCreated\":\"2021-09-06T01:44:02Z\",\"timeModified\":\"2021-03-26T17:24:30Z\",\"author\":\"vtrrmhwrbfdpyflu\",\"description\":\"vjglrocuyzlwhhme\",\"body\":\"hoocl\",\"related\":{\"categories\":[\"qmemc\",\"jk\"],\"resourceTypes\":[\"kyujxsglhsrrr\",\"ejylmbkzu\"],\"solutions\":[\"grfihotjewlp\",\"uzzjgnrefq\",\"hqo\"]},\"tags\":{\"tgbebj\":[\"iqakydiwfbr\",\"wpzdqtvhcspo\",\"aqa\",\"sipi\"],\"uhplrvkmjcwmjv\":[\"lbmoichd\",\"pnfpubntnbat\",\"viqsowsaaelcattc\"],\"idqlvhu\":[\"fggc\",\"kyylizr\",\"bjpsfxsfuztlvtm\",\"agb\"]},\"properties\":\"dataveo\"},\"id\":\"zrvjfnmjmvlwyzgi\",\"name\":\"lkujrllfojui\",\"type\":\"jpu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPackQuery response = manager.queries() - .getWithResponse("cqpbtuo", "xesz", "bbelawumuaslzk", com.azure.core.util.Context.NONE) + .getWithResponse("mtkhlowkxxpvbr", "fjmzsyzfho", "lhikcyychunsj", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("nomdrkywuhpsv", response.displayName()); - Assertions.assertEquals("niexzsrzpgepq", response.description()); - Assertions.assertEquals("yb", response.body()); - Assertions.assertEquals("gdakchz", response.related().categories().get(0)); - Assertions.assertEquals("nxm", response.related().resourceTypes().get(0)); - Assertions.assertEquals("xs", response.related().solutions().get(0)); - Assertions.assertEquals("mhruncuwm", response.tags().get("ndy").get(0)); + Assertions.assertEquals("hv", response.displayName()); + Assertions.assertEquals("vjglrocuyzlwhhme", response.description()); + Assertions.assertEquals("hoocl", response.body()); + Assertions.assertEquals("qmemc", response.related().categories().get(0)); + Assertions.assertEquals("kyujxsglhsrrr", response.related().resourceTypes().get(0)); + Assertions.assertEquals("grfihotjewlp", response.related().solutions().get(0)); + Assertions.assertEquals("iqakydiwfbr", response.tags().get("tgbebj").get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java index cebe44dbb225..57f1762ccd5f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; @@ -22,24 +22,25 @@ public final class QueriesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"id\":\"rcxfailcfxwmdb\",\"displayName\":\"xdfgsftufqobr\",\"timeCreated\":\"2021-06-10T09:16:23Z\",\"timeModified\":\"2021-07-03T04:16:46Z\",\"author\":\"cc\",\"description\":\"nhxk\",\"body\":\"zvytnrzvuljraaer\",\"related\":{\"categories\":[\"qgukkjqnv\"],\"resourceTypes\":[\"ylaxxulcdi\",\"dosfjbjsvgjrw\"],\"solutions\":[\"vyc\",\"t\",\"c\",\"xgccknfnw\"]},\"tags\":{\"z\":[\"vpdvjdhttzae\",\"edxihchrphkmcrj\",\"qnsdfzpbgtgky\",\"kdghrjeuutlwx\"],\"oajvgcxtxjcs\":[\"hokvbwnh\",\"tqlgehgppi\",\"ifhpf\"],\"q\":[\"afidltugsres\",\"kssjhoiftxfk\",\"wegprh\",\"tillucbiqtg\"]},\"properties\":\"datamcwsldrizetpwb\"},\"id\":\"lllibph\",\"name\":\"zmizakakan\",\"type\":\"p\"}]}"; + = "{\"value\":[{\"properties\":{\"id\":\"hpdulon\",\"displayName\":\"acn\",\"timeCreated\":\"2021-04-12T19:25:08Z\",\"timeModified\":\"2020-12-27T20:17:23Z\",\"author\":\"tuevrh\",\"description\":\"jyoogwxh\",\"body\":\"sd\",\"related\":{\"categories\":[\"bsre\",\"rfqkfuar\"],\"resourceTypes\":[\"vhhtklnvnaf\",\"vkyfedevjbosl\",\"qxypokkhminq\"],\"solutions\":[\"czngnbdxxe\",\"unin\"]},\"tags\":{\"xxdtddmflh\":[\"chaqdtvqec\",\"qct\"]},\"properties\":\"datatx\"},\"id\":\"tznapxbannovv\",\"name\":\"xc\",\"type\":\"ytprwnwvroev\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.queries() - .list("vodhtn", "irudh", 522814180418790552L, false, "sckdlp", com.azure.core.util.Context.NONE); + .list("eizjcpeogkhnmg", "ro", 3903099274195860527L, false, "bhfhpfpazjzoy", + com.azure.core.util.Context.NONE); - Assertions.assertEquals("xdfgsftufqobr", response.iterator().next().displayName()); - Assertions.assertEquals("nhxk", response.iterator().next().description()); - Assertions.assertEquals("zvytnrzvuljraaer", response.iterator().next().body()); - Assertions.assertEquals("qgukkjqnv", response.iterator().next().related().categories().get(0)); - Assertions.assertEquals("ylaxxulcdi", response.iterator().next().related().resourceTypes().get(0)); - Assertions.assertEquals("vyc", response.iterator().next().related().solutions().get(0)); - Assertions.assertEquals("vpdvjdhttzae", response.iterator().next().tags().get("z").get(0)); + Assertions.assertEquals("acn", response.iterator().next().displayName()); + Assertions.assertEquals("jyoogwxh", response.iterator().next().description()); + Assertions.assertEquals("sd", response.iterator().next().body()); + Assertions.assertEquals("bsre", response.iterator().next().related().categories().get(0)); + Assertions.assertEquals("vhhtklnvnaf", response.iterator().next().related().resourceTypes().get(0)); + Assertions.assertEquals("czngnbdxxe", response.iterator().next().related().solutions().get(0)); + Assertions.assertEquals("chaqdtvqec", response.iterator().next().tags().get("xxdtddmflh").get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java index a5166c94e183..14b3befb2419 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesPutWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; @@ -25,35 +25,36 @@ public final class QueriesPutWithResponseMockTests { @Test public void testPutWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"id\":\"gcmjkavl\",\"displayName\":\"or\",\"timeCreated\":\"2021-09-10T10:34:34Z\",\"timeModified\":\"2021-06-02T13:00:05Z\",\"author\":\"dtzfjltfvnzcy\",\"description\":\"otp\",\"body\":\"opv\",\"related\":{\"categories\":[\"zq\",\"qqihedsvqwthmk\"],\"resourceTypes\":[\"cysihs\",\"qcwdhoh\"],\"solutions\":[\"mcdzsufcohdxbz\",\"mcmuapc\",\"hdbevwqqxeyskon\"]},\"tags\":{\"ezrxcczurtleipqx\":[\"kfkbgbzbowxeqocl\",\"mygvkzqkj\",\"eokbze\"],\"nzvdfbzdixzmq\":[\"wvz\"],\"bostzel\":[\"odawopqhewjptmcg\"]},\"properties\":\"datala\"},\"id\":\"tmzlbiojlv\",\"name\":\"rbbpneqvcwwyy\",\"type\":\"mochpprprsnmok\"}"; + = "{\"properties\":{\"id\":\"itdigsxcdgljp\",\"displayName\":\"keuachtomf\",\"timeCreated\":\"2021-03-19T13:19:35Z\",\"timeModified\":\"2021-09-29T06:45:15Z\",\"author\":\"fpfmdgycxnmskwh\",\"description\":\"jyslurl\",\"body\":\"shhkvpedw\",\"related\":{\"categories\":[\"rhmpqvwwsk\",\"ndcbrwi\",\"uvqejosovyrrle\"],\"resourceTypes\":[\"inuqtljq\",\"bbpihehcecy\",\"mrqbrjbbmpxdlv\",\"kfrexcrseqwjks\"],\"solutions\":[\"dgzhxogj\",\"gsv\",\"u\"]},\"tags\":{\"o\":[\"bdafhrkm\",\"yomkxfbvfbhdy\",\"rhpw\",\"gddeimaw\"],\"comlikytwvczc\":[\"kkum\",\"ikjcjcazt\",\"wsnsqowx\"],\"cvejyfdvlvhbwrn\":[\"k\"],\"nkcoeqswankltyt\":[\"tgddpqthehnmnaoy\"]},\"properties\":\"datadroznn\"},\"id\":\"rlktgjcsggu\",\"name\":\"hemlwywaee\",\"type\":\"zgfbukklelssx\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPackQuery response = manager.queries() - .define("absnmfpp") - .withExistingQueryPack("tngfdgugeyzihgr", "yui") - .withTags(mapOf("asiibmiybnnust", Arrays.asList("gh", "iypoqeyhlqhykprl", "yznuciqd", "mexiitdfuxt"))) - .withDisplayName("yhsgz") - .withDescription("glqgleoh") - .withBody("betnluankrrfxee") - .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated().withCategories(Arrays.asList("j")) - .withResourceTypes(Arrays.asList("vbmqzbqq", "lajrnwxacevehj")) - .withSolutions(Arrays.asList("xoafgaoqltfae", "linmfgv"))) - .withProperties("dataljhnmgixhcmav") + .define("rrkolawjmjs") + .withExistingQueryPack("zolxrzvhqjwtr", "tgvgzp") + .withTags(mapOf("gjekglklby", Arrays.asList("hzdtxetlgydlh", "vlnnpx", "b", "fiqgeaar"))) + .withDisplayName("tlhguynuchl") + .withDescription("pafolp") + .withBody("mwamxqzragpgdph") + .withRelated(new LogAnalyticsQueryPackQueryPropertiesRelated() + .withCategories(Arrays.asList("lajv", "ejchcsrlz", "nmzlanru")) + .withResourceTypes(Arrays.asList("vnphc", "zqtpjhmq")) + .withSolutions(Arrays.asList("thlaiwdcxs"))) + .withProperties("dataidwcwvmzegjon") .create(); - Assertions.assertEquals("or", response.displayName()); - Assertions.assertEquals("otp", response.description()); - Assertions.assertEquals("opv", response.body()); - Assertions.assertEquals("zq", response.related().categories().get(0)); - Assertions.assertEquals("cysihs", response.related().resourceTypes().get(0)); - Assertions.assertEquals("mcdzsufcohdxbz", response.related().solutions().get(0)); - Assertions.assertEquals("kfkbgbzbowxeqocl", response.tags().get("ezrxcczurtleipqx").get(0)); + Assertions.assertEquals("keuachtomf", response.displayName()); + Assertions.assertEquals("jyslurl", response.description()); + Assertions.assertEquals("shhkvpedw", response.body()); + Assertions.assertEquals("rhmpqvwwsk", response.related().categories().get(0)); + Assertions.assertEquals("inuqtljq", response.related().resourceTypes().get(0)); + Assertions.assertEquals("dgzhxogj", response.related().solutions().get(0)); + Assertions.assertEquals("bdafhrkm", response.tags().get("o").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java index 92aa6353046f..a3324dc0be72 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueriesSearchMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPackQuery; @@ -27,34 +27,33 @@ public final class QueriesSearchMockTests { @Test public void testSearch() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"id\":\"heioqa\",\"displayName\":\"hvseufuqyrx\",\"timeCreated\":\"2021-03-18T00:27:23Z\",\"timeModified\":\"2020-12-31T00:49:04Z\",\"author\":\"lsismjqfrd\",\"description\":\"amqu\",\"body\":\"iosrsjuivfcdis\",\"related\":{\"categories\":[\"xzhczexrxz\",\"ujrtrhqvwr\"],\"resourceTypes\":[\"h\"],\"solutions\":[\"nzonzl\",\"piqywnc\",\"jtszcof\",\"zehtdhgb\"]},\"tags\":{\"bccxjmonfdgn\":[\"eljeamurvzmlovua\",\"ashcxlpmjerbdk\",\"lvidizozs\"],\"uqj\":[\"cypuuwwlt\"]},\"properties\":\"datazenkeifzzhmkd\"},\"id\":\"vflyhbxcu\",\"name\":\"hxgsrboldfor\",\"type\":\"wjlvizbfhfov\"}]}"; + = "{\"value\":[{\"properties\":{\"id\":\"caac\",\"displayName\":\"dmmcpugmehqep\",\"timeCreated\":\"2021-03-30T21:15:26Z\",\"timeModified\":\"2021-08-04T03:32:09Z\",\"author\":\"ehewhoqh\",\"description\":\"bqnbl\",\"body\":\"xeaclgsc\",\"related\":{\"categories\":[\"mkrsrrmoucsofl\",\"puviyfcaabe\",\"lhbhl\"],\"resourceTypes\":[\"xuqibsxtkcudf\"],\"solutions\":[\"arfsi\",\"wlkjxn\"]},\"tags\":{\"ycjimryvwgcwwpbm\":[\"gf\",\"tmhqykiz\",\"d\",\"saoafcluqvox\"]},\"properties\":\"dataw\"},\"id\":\"ydsx\",\"name\":\"efoh\",\"type\":\"cbvopwndyqleallk\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.queries() - .search("jzhajoy", "hjlmu", - new LogAnalyticsQueryPackQuerySearchProperties() - .withRelated(new LogAnalyticsQueryPackQuerySearchPropertiesRelated() - .withCategories(Arrays.asList("rimrs", "pteecjme")) - .withResourceTypes(Arrays.asList("stvasylwxdzaumw")) - .withSolutions(Arrays.asList("hguuf", "zboyjathwt"))) - .withTags(mapOf("mwmdxmebwjscjpa", Arrays.asList("a"), "ekpndzaapmudq", - Arrays.asList("xveabf", "xnmwmqtibxyijddt", "qcttadijaeukmrsi"), "e", - Arrays.asList("qwigpibudqwyxe"))), - 5927921282145979607L, true, "zznrtffyaqi", com.azure.core.util.Context.NONE); + .search("tlyo", "rrrouuxvnsa", new LogAnalyticsQueryPackQuerySearchProperties() + .withRelated( + new LogAnalyticsQueryPackQuerySearchPropertiesRelated().withCategories(Arrays.asList("ymodizrxk")) + .withResourceTypes(Arrays.asList("d", "nazpmk")) + .withSolutions(Arrays.asList("vevfxz"))) + .withTags(mapOf("p", Arrays.asList("bzxliohrdddtfgxq", "awpcbbnzqcykn"), "bwwg", + Arrays.asList("fyuicdh", "bd"), "muvapc", Arrays.asList("vibidmhmwffpl"), "mfsvbpav", + Arrays.asList("crrvweyo", "oy", "ukphaimmoiroq", "oshbragapyy"))), + 5906080066098666385L, false, "ppdbwnupgahxkum", com.azure.core.util.Context.NONE); - Assertions.assertEquals("hvseufuqyrx", response.iterator().next().displayName()); - Assertions.assertEquals("amqu", response.iterator().next().description()); - Assertions.assertEquals("iosrsjuivfcdis", response.iterator().next().body()); - Assertions.assertEquals("xzhczexrxz", response.iterator().next().related().categories().get(0)); - Assertions.assertEquals("h", response.iterator().next().related().resourceTypes().get(0)); - Assertions.assertEquals("nzonzl", response.iterator().next().related().solutions().get(0)); - Assertions.assertEquals("eljeamurvzmlovua", response.iterator().next().tags().get("bccxjmonfdgn").get(0)); + Assertions.assertEquals("dmmcpugmehqep", response.iterator().next().displayName()); + Assertions.assertEquals("bqnbl", response.iterator().next().description()); + Assertions.assertEquals("xeaclgsc", response.iterator().next().body()); + Assertions.assertEquals("mkrsrrmoucsofl", response.iterator().next().related().categories().get(0)); + Assertions.assertEquals("xuqibsxtkcudf", response.iterator().next().related().resourceTypes().get(0)); + Assertions.assertEquals("arfsi", response.iterator().next().related().solutions().get(0)); + Assertions.assertEquals("gf", response.iterator().next().tags().get("ycjimryvwgcwwpbm").get(0)); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java index 5d446e46190b..5c2cada33883 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -23,24 +23,24 @@ public final class QueryPacksCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"queryPackId\":\"nlsvxeiz\",\"timeCreated\":\"2021-09-15T09:10:38Z\",\"timeModified\":\"2021-10-15T15:15:24Z\",\"provisioningState\":\"srmffeycxcktpiym\"},\"location\":\"rteeamm\",\"tags\":{\"rtkgdojbmxvavref\":\"ekkkzd\",\"jpxtxsuwprtuj\":\"eesvecu\",\"itvtzeexavo\":\"sawddjibabxvi\",\"dmdqb\":\"tfgle\"},\"id\":\"pypqtgsfj\",\"name\":\"cbslhhx\",\"type\":\"db\"}"; + = "{\"properties\":{\"queryPackId\":\"emv\",\"timeCreated\":\"2021-10-29T03:31:17Z\",\"timeModified\":\"2020-12-21T13:58:30Z\",\"provisioningState\":\"hmnr\"},\"location\":\"bsojk\",\"tags\":{\"ysprq\":\"hmdp\",\"pli\":\"gnzxojpslsvj\",\"qvapcohhoucq\":\"fiqwoy\"},\"id\":\"q\",\"name\":\"jxcx\",\"type\":\"rzdcgdzbenribcaw\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPack response = manager.queryPacks() - .define("vbkbxgomf") - .withRegion("zkgimsid") - .withExistingResourceGroup("nsymoyqhlwigd") - .withTags(mapOf("hpqgatjeaahhvj", "icddyvvjskgfmocw", "jjidjk", "hnakzyb")) + .define("byrrueqth") + .withRegion("yqyybxubmdna") + .withExistingResourceGroup("yueayfbpcmsp") + .withTags(mapOf("qacigeleo", "qwremjel", "vqvwzkjopwbe", "d", "x", "nrlkwzdqy")) .create(); - Assertions.assertEquals("rteeamm", response.location()); - Assertions.assertEquals("ekkkzd", response.tags().get("rtkgdojbmxvavref")); + Assertions.assertEquals("bsojk", response.location()); + Assertions.assertEquals("hmdp", response.tags().get("ysprq")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java index 5805a5f8e9f9..b02f3f534120 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.fluent.models.LogAnalyticsQueryPackInner; @@ -24,23 +24,24 @@ public final class QueryPacksCreateOrUpdateWithoutNameWithResponseMockTests { @Test public void testCreateOrUpdateWithoutNameWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"queryPackId\":\"xukuqgsj\",\"timeCreated\":\"2021-08-01T00:57:39Z\",\"timeModified\":\"2021-06-29T21:31:03Z\",\"provisioningState\":\"gketwzhhzjhf\"},\"location\":\"mhv\",\"tags\":{\"qsxvmhf\":\"vgpmun\"},\"id\":\"uzjyihsasbhudypo\",\"name\":\"yue\",\"type\":\"slynsqyrpfoo\"}"; + = "{\"properties\":{\"queryPackId\":\"rgmsplzga\",\"timeCreated\":\"2021-02-13T02:42:05Z\",\"timeModified\":\"2021-02-02T09:58:56Z\",\"provisioningState\":\"vnewgnxkympqanx\"},\"location\":\"kixtwbtaoy\",\"tags\":{\"pxycphdr\":\"ghshxcylhkgmnsg\"},\"id\":\"jjkhvyomaclu\",\"name\":\"vxnqmhrpqpd\",\"type\":\"wmkoisq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 201, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPack response = manager.queryPacks() - .createOrUpdateWithoutNameWithResponse("fiwrxgkn", - new LogAnalyticsQueryPackInner().withLocation("gzdjtxvzf").withTags(mapOf("aqvlgafcqusr", "v")), + .createOrUpdateWithoutNameWithResponse("wfiwzcxmj", + new LogAnalyticsQueryPackInner().withLocation("cabvnuil") + .withTags(mapOf("ugmrmf", "aswlp", "oauk", "lrxw", "moaedsxj", "fkvcisi")), com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("mhv", response.location()); - Assertions.assertEquals("vgpmun", response.tags().get("qsxvmhf")); + Assertions.assertEquals("kixtwbtaoy", response.location()); + Assertions.assertEquals("ghshxcylhkgmnsg", response.tags().get("pxycphdr")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java index 5db48519b0d3..ec13a6955468 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksDeleteByResourceGroupWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,11 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.queryPacks() - .deleteByResourceGroupWithResponse("rlttymsjnygqdnfw", "zdzgtilaxhnfhqly", - com.azure.core.util.Context.NONE); + .deleteByResourceGroupWithResponse("ssffxuifmc", "ypobkdqzr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java index 4635a85ab2c9..2048593384ce 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksGetByResourceGroupWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -21,20 +21,20 @@ public final class QueryPacksGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"queryPackId\":\"pgclrciv\",\"timeCreated\":\"2021-01-12T06:52:04Z\",\"timeModified\":\"2020-12-22T20:01:29Z\",\"provisioningState\":\"kenx\"},\"location\":\"m\",\"tags\":{\"oqvm\":\"frpmpdnqqskaw\"},\"id\":\"bnpqfrtqlkzme\",\"name\":\"nitgvkxlz\",\"type\":\"qdrfegcealzxwhc\"}"; + = "{\"properties\":{\"queryPackId\":\"uaurkihcir\",\"timeCreated\":\"2021-04-17T15:27:55Z\",\"timeModified\":\"2021-09-20T22:33:09Z\",\"provisioningState\":\"dcoxnbk\"},\"location\":\"anurnnqb\",\"tags\":{\"rxvbfihwuh\":\"pizxqltgrdogyp\",\"iowxi\":\"ctafsrbxrblm\",\"klsbsbqqqagw\":\"spnxwqagnepzw\"},\"id\":\"rxaomzisglrrcze\",\"name\":\"k\",\"type\":\"hltnjadhqoawjq\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); LogAnalyticsQueryPack response = manager.queryPacks() - .getByResourceGroupWithResponse("ijouwivkxoyzunb", "xxrtikvc", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("zsylollgt", "czzydmxzjij", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("m", response.location()); - Assertions.assertEquals("frpmpdnqqskaw", response.tags().get("oqvm")); + Assertions.assertEquals("anurnnqb", response.location()); + Assertions.assertEquals("pizxqltgrdogyp", response.tags().get("rxvbfihwuh")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java index 0e8fd6299f34..402d3c1d2c70 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListByResourceGroupMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -22,19 +22,19 @@ public final class QueryPacksListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"queryPackId\":\"aomylwea\",\"timeCreated\":\"2021-12-02T19:30Z\",\"timeModified\":\"2021-02-22T04:35:52Z\",\"provisioningState\":\"thwwn\"},\"location\":\"jhlfzswpchwahf\",\"tags\":{\"ncxykxhdjhlimm\":\"snfepgfewetwlyx\",\"cjzhqi\":\"cxfhbcporxv\",\"ftjuh\":\"xfpxtgqscja\"},\"id\":\"qaz\",\"name\":\"mtggu\",\"type\":\"pijrajcivmmghf\"}]}"; + = "{\"value\":[{\"properties\":{\"queryPackId\":\"wslmiiiovgqcg\",\"timeCreated\":\"2021-03-09T10:20:04Z\",\"timeModified\":\"2021-07-06T10:58:26Z\",\"provisioningState\":\"ctotiowlx\"},\"location\":\"qd\",\"tags\":{\"lwphqlkccuzgyg\":\"gwdtgukran\",\"gniiprglvaw\":\"wahoiul\",\"pmcubkmifoxxkub\":\"wzdufypivlsbb\",\"gvgovpbbttefjo\":\"phavpmhbrb\"},\"id\":\"nssqyzqed\",\"name\":\"kdfrdbiqmrjgeihf\",\"type\":\"lg\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.queryPacks().listByResourceGroup("oaimlnw", com.azure.core.util.Context.NONE); + = manager.queryPacks().listByResourceGroup("kkflrmymyincqlhr", com.azure.core.util.Context.NONE); - Assertions.assertEquals("jhlfzswpchwahf", response.iterator().next().location()); - Assertions.assertEquals("snfepgfewetwlyx", response.iterator().next().tags().get("ncxykxhdjhlimm")); + Assertions.assertEquals("qd", response.iterator().next().location()); + Assertions.assertEquals("gwdtgukran", response.iterator().next().tags().get("lwphqlkccuzgyg")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java index e80c92f3388b..5fb621aeec76 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.LogAnalyticsQueryPack; @@ -22,18 +22,18 @@ public final class QueryPacksListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"queryPackId\":\"pkxztmoobkl\",\"timeCreated\":\"2021-05-25T12:15:23Z\",\"timeModified\":\"2021-09-03T03:39:31Z\",\"provisioningState\":\"cwq\"},\"location\":\"pimaqxzhemjyh\",\"tags\":{\"lkb\":\"jswtwkozzwc\"},\"id\":\"wpfaj\",\"name\":\"jwltlwtjjgu\",\"type\":\"talhsnvkcdmxzr\"}]}"; + = "{\"value\":[{\"properties\":{\"queryPackId\":\"ycsxzu\",\"timeCreated\":\"2021-06-18T01:50:48Z\",\"timeModified\":\"2021-11-03T00:52:43Z\",\"provisioningState\":\"mdesqp\"},\"location\":\"vmjcdoewb\",\"tags\":{\"xvgpiude\":\"vteo\",\"axwk\":\"gfsxzec\",\"znabaobns\":\"fykhvuhxepmru\",\"ihywartspph\":\"ujdjltymkmvg\"},\"id\":\"ixkykxd\",\"name\":\"sj\",\"type\":\"emmucfxh\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.queryPacks().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("pimaqxzhemjyh", response.iterator().next().location()); - Assertions.assertEquals("jswtwkozzwc", response.iterator().next().tags().get("lkb")); + Assertions.assertEquals("vmjcdoewb", response.iterator().next().location()); + Assertions.assertEquals("vteo", response.iterator().next().tags().get("xvgpiude")); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksResourceTests.java deleted file mode 100644 index 7bb9c15f45e0..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/QueryPacksResourceTests.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.QueryPacksResource; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class QueryPacksResourceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QueryPacksResource model = BinaryData.fromString( - "{\"location\":\"lokjyemkk\",\"tags\":{\"ejspodmail\":\"pjoxzjnch\",\"yahux\":\"ydehoj\",\"vcputegj\":\"npmqnjaqwixjspro\",\"uuvmkjozkrwfnd\":\"wmfdatscmdvpjhul\"},\"id\":\"odjpslwejd\",\"name\":\"vwryoqpso\",\"type\":\"cctazakljlahbc\"}") - .toObject(QueryPacksResource.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QueryPacksResource model = new QueryPacksResource().withLocation("lokjyemkk") - .withTags(mapOf("ejspodmail", "pjoxzjnch", "yahux", "ydehoj", "vcputegj", "npmqnjaqwixjspro", - "uuvmkjozkrwfnd", "wmfdatscmdvpjhul")); - model = BinaryData.fromObject(model).toObject(QueryPacksResource.class); - Assertions.assertEquals("lokjyemkk", model.location()); - Assertions.assertEquals("pjoxzjnch", model.tags().get("ejspodmail")); - } - - // 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/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResourceAssociationTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResourceAssociationTests.java new file mode 100644 index 000000000000..4cf7556677b5 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResourceAssociationTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociation; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import org.junit.jupiter.api.Assertions; + +public final class ResourceAssociationTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ResourceAssociation model = BinaryData.fromString("{\"name\":\"fnmdxotn\",\"accessMode\":\"Learning\"}") + .toObject(ResourceAssociation.class); + Assertions.assertEquals("fnmdxotn", model.name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, model.accessMode()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ResourceAssociation model + = new ResourceAssociation().withName("fnmdxotn").withAccessMode(ResourceAssociationAccessMode.LEARNING); + model = BinaryData.fromObject(model).toObject(ResourceAssociation.class); + Assertions.assertEquals("fnmdxotn", model.name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, model.accessMode()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java index b37076c3ed16..27622c44b1bb 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RestoredLogsTests.java @@ -13,21 +13,21 @@ public final class RestoredLogsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RestoredLogs model = BinaryData.fromString( - "{\"startRestoreTime\":\"2021-08-18T12:02:08Z\",\"endRestoreTime\":\"2021-10-23T03:32:09Z\",\"sourceTable\":\"zydvfvf\",\"azureAsyncOperationId\":\"naeo\"}") + "{\"startRestoreTime\":\"2021-10-09T17:15:47Z\",\"endRestoreTime\":\"2021-11-26T04:46:53Z\",\"sourceTable\":\"cedcpnmdy\",\"azureAsyncOperationId\":\"nwzxltjcv\"}") .toObject(RestoredLogs.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T12:02:08Z"), model.startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T03:32:09Z"), model.endRestoreTime()); - Assertions.assertEquals("zydvfvf", model.sourceTable()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T17:15:47Z"), model.startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T04:46:53Z"), model.endRestoreTime()); + Assertions.assertEquals("cedcpnmdy", model.sourceTable()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - RestoredLogs model = new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-08-18T12:02:08Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-10-23T03:32:09Z")) - .withSourceTable("zydvfvf"); + RestoredLogs model = new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-10-09T17:15:47Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-11-26T04:46:53Z")) + .withSourceTable("cedcpnmdy"); model = BinaryData.fromObject(model).toObject(RestoredLogs.class); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-18T12:02:08Z"), model.startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T03:32:09Z"), model.endRestoreTime()); - Assertions.assertEquals("zydvfvf", model.sourceTable()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-09T17:15:47Z"), model.startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-26T04:46:53Z"), model.endRestoreTime()); + Assertions.assertEquals("cedcpnmdy", model.sourceTable()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java index e9b3a05e3a98..b72f364ca3ad 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/ResultStatisticsTests.java @@ -11,7 +11,7 @@ public final class ResultStatisticsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { ResultStatistics model - = BinaryData.fromString("{\"progress\":40.47698,\"ingestedRecords\":1226403170,\"scannedGb\":23.974842}") + = BinaryData.fromString("{\"progress\":68.59587,\"ingestedRecords\":823307226,\"scannedGb\":19.583012}") .toObject(ResultStatistics.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RuleDefinitionTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RuleDefinitionTests.java new file mode 100644 index 000000000000..58aab975fbdf --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/RuleDefinitionTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.RuleDefinition; +import com.azure.resourcemanager.loganalytics.models.TimeSelectorEnum; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class RuleDefinitionTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + RuleDefinition model = BinaryData.fromString( + "{\"query\":\"hahzvechndbnwi\",\"binSize\":1717475306,\"binDelay\":36238226,\"binStartTime\":\"2021-06-22T19:10:38Z\",\"timeSelector\":\"TimeGenerated\",\"destinationTable\":\"ubwefqs\"}") + .toObject(RuleDefinition.class); + Assertions.assertEquals("hahzvechndbnwi", model.query()); + Assertions.assertEquals(1717475306, model.binSize()); + Assertions.assertEquals(36238226, model.binDelay()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T19:10:38Z"), model.binStartTime()); + Assertions.assertEquals(TimeSelectorEnum.TIME_GENERATED, model.timeSelector()); + Assertions.assertEquals("ubwefqs", model.destinationTable()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + RuleDefinition model = new RuleDefinition().withQuery("hahzvechndbnwi") + .withBinSize(1717475306) + .withBinDelay(36238226) + .withBinStartTime(OffsetDateTime.parse("2021-06-22T19:10:38Z")) + .withTimeSelector(TimeSelectorEnum.TIME_GENERATED) + .withDestinationTable("ubwefqs"); + model = BinaryData.fromObject(model).toObject(RuleDefinition.class); + Assertions.assertEquals("hahzvechndbnwi", model.query()); + Assertions.assertEquals(1717475306, model.binSize()); + Assertions.assertEquals(36238226, model.binDelay()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-22T19:10:38Z"), model.binStartTime()); + Assertions.assertEquals(TimeSelectorEnum.TIME_GENERATED, model.timeSelector()); + Assertions.assertEquals("ubwefqs", model.destinationTable()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java index f3d67547b9b4..5712414c503d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchInnerTests.java @@ -14,38 +14,38 @@ public final class SavedSearchInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SavedSearchInner model = BinaryData.fromString( - "{\"etag\":\"xc\",\"properties\":{\"category\":\"sbfov\",\"displayName\":\"srruvwbhsqfsubcg\",\"query\":\"birx\",\"functionAlias\":\"ybsrfbjfdtwss\",\"functionParameters\":\"ftpvjzbexil\",\"version\":8368126717708512338,\"tags\":[{\"name\":\"nvwpmqtaruouj\",\"value\":\"kcjhwqytjrybnwj\"}]},\"id\":\"wgdrjervnaenqp\",\"name\":\"hin\",\"type\":\"oygmift\"}") + "{\"etag\":\"mv\",\"properties\":{\"category\":\"ekg\",\"displayName\":\"wozuhkf\",\"query\":\"bsjyofdx\",\"functionAlias\":\"us\",\"functionParameters\":\"touwaboekqv\",\"version\":2699583635820054770,\"tags\":[{\"name\":\"vbxwyjsflhh\",\"value\":\"aalnjixi\"}]},\"id\":\"xyawj\",\"name\":\"yaqcslyjpkiidz\",\"type\":\"exznelixhnr\"}") .toObject(SavedSearchInner.class); - Assertions.assertEquals("xc", model.etag()); - Assertions.assertEquals("sbfov", model.category()); - Assertions.assertEquals("srruvwbhsqfsubcg", model.displayName()); - Assertions.assertEquals("birx", model.query()); - Assertions.assertEquals("ybsrfbjfdtwss", model.functionAlias()); - Assertions.assertEquals("ftpvjzbexil", model.functionParameters()); - Assertions.assertEquals(8368126717708512338L, model.version()); - Assertions.assertEquals("nvwpmqtaruouj", model.tags().get(0).name()); - Assertions.assertEquals("kcjhwqytjrybnwj", model.tags().get(0).value()); + Assertions.assertEquals("mv", model.etag()); + Assertions.assertEquals("ekg", model.category()); + Assertions.assertEquals("wozuhkf", model.displayName()); + Assertions.assertEquals("bsjyofdx", model.query()); + Assertions.assertEquals("us", model.functionAlias()); + Assertions.assertEquals("touwaboekqv", model.functionParameters()); + Assertions.assertEquals(2699583635820054770L, model.version()); + Assertions.assertEquals("vbxwyjsflhh", model.tags().get(0).name()); + Assertions.assertEquals("aalnjixi", model.tags().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SavedSearchInner model = new SavedSearchInner().withEtag("xc") - .withCategory("sbfov") - .withDisplayName("srruvwbhsqfsubcg") - .withQuery("birx") - .withFunctionAlias("ybsrfbjfdtwss") - .withFunctionParameters("ftpvjzbexil") - .withVersion(8368126717708512338L) - .withTags(Arrays.asList(new Tag().withName("nvwpmqtaruouj").withValue("kcjhwqytjrybnwj"))); + SavedSearchInner model = new SavedSearchInner().withEtag("mv") + .withCategory("ekg") + .withDisplayName("wozuhkf") + .withQuery("bsjyofdx") + .withFunctionAlias("us") + .withFunctionParameters("touwaboekqv") + .withVersion(2699583635820054770L) + .withTags(Arrays.asList(new Tag().withName("vbxwyjsflhh").withValue("aalnjixi"))); model = BinaryData.fromObject(model).toObject(SavedSearchInner.class); - Assertions.assertEquals("xc", model.etag()); - Assertions.assertEquals("sbfov", model.category()); - Assertions.assertEquals("srruvwbhsqfsubcg", model.displayName()); - Assertions.assertEquals("birx", model.query()); - Assertions.assertEquals("ybsrfbjfdtwss", model.functionAlias()); - Assertions.assertEquals("ftpvjzbexil", model.functionParameters()); - Assertions.assertEquals(8368126717708512338L, model.version()); - Assertions.assertEquals("nvwpmqtaruouj", model.tags().get(0).name()); - Assertions.assertEquals("kcjhwqytjrybnwj", model.tags().get(0).value()); + Assertions.assertEquals("mv", model.etag()); + Assertions.assertEquals("ekg", model.category()); + Assertions.assertEquals("wozuhkf", model.displayName()); + Assertions.assertEquals("bsjyofdx", model.query()); + Assertions.assertEquals("us", model.functionAlias()); + Assertions.assertEquals("touwaboekqv", model.functionParameters()); + Assertions.assertEquals(2699583635820054770L, model.version()); + Assertions.assertEquals("vbxwyjsflhh", model.tags().get(0).name()); + Assertions.assertEquals("aalnjixi", model.tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java index 48746c228292..133048ecba43 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchPropertiesTests.java @@ -14,37 +14,36 @@ public final class SavedSearchPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SavedSearchProperties model = BinaryData.fromString( - "{\"category\":\"nzdndslgna\",\"displayName\":\"qig\",\"query\":\"nduhavhqlkthum\",\"functionAlias\":\"olbgycduiertgccy\",\"functionParameters\":\"aolps\",\"version\":1053709421770726696,\"tags\":[{\"name\":\"mdnbbglzpswiy\",\"value\":\"mcwyhzdxssadb\"},{\"name\":\"mnvdfzn\",\"value\":\"daodvxzbncblyl\"},{\"name\":\"stdbhhxsrzdzu\",\"value\":\"erscdntne\"}]}") + "{\"category\":\"tfolhbnx\",\"displayName\":\"nalaulppg\",\"query\":\"dtpnapnyiropuhp\",\"functionAlias\":\"vpgylgqgitxmed\",\"functionParameters\":\"c\",\"version\":6530746203139727560,\"tags\":[{\"name\":\"wncwzzhxgktrmg\",\"value\":\"cnapkteoell\"},{\"name\":\"pt\",\"value\":\"d\"},{\"name\":\"gpfqbuace\",\"value\":\"pzfqrhhuaoppp\"}]}") .toObject(SavedSearchProperties.class); - Assertions.assertEquals("nzdndslgna", model.category()); - Assertions.assertEquals("qig", model.displayName()); - Assertions.assertEquals("nduhavhqlkthum", model.query()); - Assertions.assertEquals("olbgycduiertgccy", model.functionAlias()); - Assertions.assertEquals("aolps", model.functionParameters()); - Assertions.assertEquals(1053709421770726696L, model.version()); - Assertions.assertEquals("mdnbbglzpswiy", model.tags().get(0).name()); - Assertions.assertEquals("mcwyhzdxssadb", model.tags().get(0).value()); + Assertions.assertEquals("tfolhbnx", model.category()); + Assertions.assertEquals("nalaulppg", model.displayName()); + Assertions.assertEquals("dtpnapnyiropuhp", model.query()); + Assertions.assertEquals("vpgylgqgitxmed", model.functionAlias()); + Assertions.assertEquals("c", model.functionParameters()); + Assertions.assertEquals(6530746203139727560L, model.version()); + Assertions.assertEquals("wncwzzhxgktrmg", model.tags().get(0).name()); + Assertions.assertEquals("cnapkteoell", model.tags().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SavedSearchProperties model = new SavedSearchProperties().withCategory("nzdndslgna") - .withDisplayName("qig") - .withQuery("nduhavhqlkthum") - .withFunctionAlias("olbgycduiertgccy") - .withFunctionParameters("aolps") - .withVersion(1053709421770726696L) - .withTags(Arrays.asList(new Tag().withName("mdnbbglzpswiy").withValue("mcwyhzdxssadb"), - new Tag().withName("mnvdfzn").withValue("daodvxzbncblyl"), - new Tag().withName("stdbhhxsrzdzu").withValue("erscdntne"))); + SavedSearchProperties model = new SavedSearchProperties().withCategory("tfolhbnx") + .withDisplayName("nalaulppg") + .withQuery("dtpnapnyiropuhp") + .withFunctionAlias("vpgylgqgitxmed") + .withFunctionParameters("c") + .withVersion(6530746203139727560L) + .withTags(Arrays.asList(new Tag().withName("wncwzzhxgktrmg").withValue("cnapkteoell"), + new Tag().withName("pt").withValue("d"), new Tag().withName("gpfqbuace").withValue("pzfqrhhuaoppp"))); model = BinaryData.fromObject(model).toObject(SavedSearchProperties.class); - Assertions.assertEquals("nzdndslgna", model.category()); - Assertions.assertEquals("qig", model.displayName()); - Assertions.assertEquals("nduhavhqlkthum", model.query()); - Assertions.assertEquals("olbgycduiertgccy", model.functionAlias()); - Assertions.assertEquals("aolps", model.functionParameters()); - Assertions.assertEquals(1053709421770726696L, model.version()); - Assertions.assertEquals("mdnbbglzpswiy", model.tags().get(0).name()); - Assertions.assertEquals("mcwyhzdxssadb", model.tags().get(0).value()); + Assertions.assertEquals("tfolhbnx", model.category()); + Assertions.assertEquals("nalaulppg", model.displayName()); + Assertions.assertEquals("dtpnapnyiropuhp", model.query()); + Assertions.assertEquals("vpgylgqgitxmed", model.functionAlias()); + Assertions.assertEquals("c", model.functionParameters()); + Assertions.assertEquals(6530746203139727560L, model.version()); + Assertions.assertEquals("wncwzzhxgktrmg", model.tags().get(0).name()); + Assertions.assertEquals("cnapkteoell", model.tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java index 7cb0ef1ba341..1a82fbfd7007 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesCreateOrUpdateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.SavedSearch; @@ -23,37 +23,39 @@ public final class SavedSearchesCreateOrUpdateWithResponseMockTests { @Test public void testCreateOrUpdateWithResponse() throws Exception { String responseStr - = "{\"etag\":\"refqy\",\"properties\":{\"category\":\"qotoihiqakydiwfb\",\"displayName\":\"kwpzdqtvh\",\"query\":\"spodaqax\",\"functionAlias\":\"pie\",\"functionParameters\":\"bebjfu\",\"version\":8153035996823274813,\"tags\":[{\"name\":\"h\",\"value\":\"lpnfpubntnb\"},{\"name\":\"tzviqsowsaaelcat\",\"value\":\"cjuhplrvkm\"},{\"name\":\"cwmjvlg\",\"value\":\"ggcvk\"}]},\"id\":\"y\",\"name\":\"izrzb\",\"type\":\"psfxsf\"}"; + = "{\"etag\":\"nynkbwet\",\"properties\":{\"category\":\"juhpsprkzyau\",\"displayName\":\"ia\",\"query\":\"cxnafbwqrooh\",\"functionAlias\":\"ovmaonurjtum\",\"functionParameters\":\"ihpvecmslclblyj\",\"version\":1273828074911332298,\"tags\":[{\"name\":\"uscv\",\"value\":\"f\"},{\"name\":\"igctmgxuupbezq\",\"value\":\"cydrtceukdqkk\"}]},\"id\":\"ihztgeqmgqzgwldo\",\"name\":\"chillcecf\",\"type\":\"huwaoaguhic\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SavedSearch response = manager.savedSearches() - .define("ikcyyc") - .withExistingWorkspace("khlowkxxpv", "rdfjmzsyzfhotl") - .withCategory("hv") - .withDisplayName("uic") - .withQuery("hvtrrmhwrbfdpyf") - .withTags(Arrays.asList(new Tag().withName("ooclutnp").withValue("memczjkmmyk"), - new Tag().withName("ujxsglhsr").withValue("rye"))) - .withEtag("nsjlpjrtws") - .withFunctionAlias("bhvjglr") - .withFunctionParameters("uyzlw") - .withVersion(5515716031108163936L) + .define("uzivensrpmeyyvp") + .withExistingWorkspace("lpdwwexymzvlazi", "bhpwvqsgnyy") + .withCategory("jp") + .withDisplayName("gsksrfhf") + .withQuery("olmk") + .withTags(Arrays.asList(new Tag().withName("uiaclkiexhajlfn").withValue("hiqfyuttdiy"), + new Tag().withName("b").withValue("vnwsw"), + new Tag().withName("txkyctwwgzwxjlm").withValue("cvogygzyvne"), + new Tag().withName("zaifghtmoqqtlff").withValue("zbkr"))) + .withEtag("atlb") + .withFunctionAlias("nxwcdommpv") + .withFunctionParameters("awz") + .withVersion(371412437274292802L) .create(); - Assertions.assertEquals("refqy", response.etag()); - Assertions.assertEquals("qotoihiqakydiwfb", response.category()); - Assertions.assertEquals("kwpzdqtvh", response.displayName()); - Assertions.assertEquals("spodaqax", response.query()); - Assertions.assertEquals("pie", response.functionAlias()); - Assertions.assertEquals("bebjfu", response.functionParameters()); - Assertions.assertEquals(8153035996823274813L, response.version()); - Assertions.assertEquals("h", response.tags().get(0).name()); - Assertions.assertEquals("lpnfpubntnb", response.tags().get(0).value()); + Assertions.assertEquals("nynkbwet", response.etag()); + Assertions.assertEquals("juhpsprkzyau", response.category()); + Assertions.assertEquals("ia", response.displayName()); + Assertions.assertEquals("cxnafbwqrooh", response.query()); + Assertions.assertEquals("ovmaonurjtum", response.functionAlias()); + Assertions.assertEquals("ihpvecmslclblyj", response.functionParameters()); + Assertions.assertEquals(1273828074911332298L, response.version()); + Assertions.assertEquals("uscv", response.tags().get(0).name()); + Assertions.assertEquals("f", response.tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java index 75719dae958f..4f5a5307d24f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.savedSearches() - .deleteWithResponse("fcsserxhtvsox", "lwntsjgqrs", "y", com.azure.core.util.Context.NONE); + .deleteWithResponse("tzqdd", "jwfljhznamtua", "mzwcjjncqt", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java index c8563f46f382..852804f280c1 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.SavedSearch; @@ -21,27 +21,26 @@ public final class SavedSearchesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"etag\":\"gm\",\"properties\":{\"category\":\"rwahzjmucftbyr\",\"displayName\":\"lrohkpig\",\"query\":\"fusuckzmkwklsno\",\"functionAlias\":\"xmqeqalh\",\"functionParameters\":\"nhg\",\"version\":2571955917130233939,\"tags\":[{\"name\":\"fsvkhgbvqtanarfd\",\"value\":\"pukhpyrne\"},{\"name\":\"zjcpeogk\",\"value\":\"nmg\"}]},\"id\":\"ro\",\"name\":\"xddbhfhpfpaz\",\"type\":\"zoyw\"}"; + = "{\"etag\":\"uvbxngr\",\"properties\":{\"category\":\"bwggahtt\",\"displayName\":\"lswva\",\"query\":\"qfutlxjo\",\"functionAlias\":\"asunwqrjzfrgq\",\"functionParameters\":\"ohcmbu\",\"version\":765942631551785851,\"tags\":[{\"name\":\"hmbpyryxamebly\",\"value\":\"yvk\"},{\"name\":\"kmrocxne\",\"value\":\"v\"}]},\"id\":\"mtodl\",\"name\":\"pyapucygvoav\",\"type\":\"unssxlghieegjl\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - SavedSearch response = manager.savedSearches() - .getWithResponse("ruuuybnch", "szizoyuelyetndnb", "qyggagfl", com.azure.core.util.Context.NONE) - .getValue(); + SavedSearch response + = manager.savedSearches().getWithResponse("z", "izvg", "gat", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("gm", response.etag()); - Assertions.assertEquals("rwahzjmucftbyr", response.category()); - Assertions.assertEquals("lrohkpig", response.displayName()); - Assertions.assertEquals("fusuckzmkwklsno", response.query()); - Assertions.assertEquals("xmqeqalh", response.functionAlias()); - Assertions.assertEquals("nhg", response.functionParameters()); - Assertions.assertEquals(2571955917130233939L, response.version()); - Assertions.assertEquals("fsvkhgbvqtanarfd", response.tags().get(0).name()); - Assertions.assertEquals("pukhpyrne", response.tags().get(0).value()); + Assertions.assertEquals("uvbxngr", response.etag()); + Assertions.assertEquals("bwggahtt", response.category()); + Assertions.assertEquals("lswva", response.displayName()); + Assertions.assertEquals("qfutlxjo", response.query()); + Assertions.assertEquals("asunwqrjzfrgq", response.functionAlias()); + Assertions.assertEquals("ohcmbu", response.functionParameters()); + Assertions.assertEquals(765942631551785851L, response.version()); + Assertions.assertEquals("hmbpyryxamebly", response.tags().get(0).name()); + Assertions.assertEquals("yvk", response.tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java index 3ab8a59de174..b5d812ed4b24 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListByWorkspaceWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.SavedSearchesListResult; @@ -21,27 +21,27 @@ public final class SavedSearchesListByWorkspaceWithResponseMockTests { @Test public void testListByWorkspaceWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"etag\":\"xh\",\"properties\":{\"category\":\"sd\",\"displayName\":\"ugwbsreurfqkf\",\"query\":\"arenlvhhtklnvnaf\",\"functionAlias\":\"kyfede\",\"functionParameters\":\"bo\",\"version\":5433915956599731708,\"tags\":[{\"name\":\"p\",\"value\":\"kkhminqcymczngn\"}]},\"id\":\"dxxewuninv\",\"name\":\"db\",\"type\":\"h\"},{\"etag\":\"dtvqe\",\"properties\":{\"category\":\"rqctmxxdtdd\",\"displayName\":\"flhuytxzv\",\"query\":\"zna\",\"functionAlias\":\"bannovvoxczytp\",\"functionParameters\":\"nwvroevytlyokrr\",\"version\":4414369503729973449,\"tags\":[{\"name\":\"nsa\",\"value\":\"bcrymodizrx\"},{\"name\":\"lobdxna\",\"value\":\"pmkmlmvevfx\"},{\"name\":\"op\",\"value\":\"hbzxli\"},{\"name\":\"hrdd\",\"value\":\"tfgxqbawpcb\"}]},\"id\":\"nzqcy\",\"name\":\"napqo\",\"type\":\"yuicdhzbdy\"},{\"etag\":\"wgbdvibidmhmwffp\",\"properties\":{\"category\":\"fmuvapckccr\",\"displayName\":\"vwe\",\"query\":\"oxoyyukp\",\"functionAlias\":\"immoiroqboshbrag\",\"functionParameters\":\"yyrmfsvbp\",\"version\":3531624930963004551,\"tags\":[{\"name\":\"ppdbwnupgahxkum\",\"value\":\"sjcaacfdmmcpugm\"},{\"name\":\"hqepvufhbzehewh\",\"value\":\"qhnlbqnbld\"}]},\"id\":\"eaclgschorimk\",\"name\":\"srrm\",\"type\":\"ucsofldpuviyf\"},{\"etag\":\"abeolhbhlvbm\",\"properties\":{\"category\":\"uqibsxtkcu\",\"displayName\":\"fbsfarfsiow\",\"query\":\"kjxnqpvwgfstmhq\",\"functionAlias\":\"izmdksa\",\"functionParameters\":\"fcluqvo\",\"version\":8904305259908062937,\"tags\":[{\"name\":\"mr\",\"value\":\"vwg\"}]},\"id\":\"wwpbmzgwesyd\",\"name\":\"xwefohecbvopwndy\",\"type\":\"leallklm\"}]}"; + = "{\"value\":[{\"etag\":\"i\",\"properties\":{\"category\":\"irpiwrqofulopmj\",\"displayName\":\"lexwhcbjp\",\"query\":\"bke\",\"functionAlias\":\"uuuercta\",\"functionParameters\":\"yintqpbrlcy\",\"version\":5915975308764094349,\"tags\":[{\"name\":\"go\",\"value\":\"xyf\"}]},\"id\":\"rucvcrrpcjttbs\",\"name\":\"vjeaqnrmvvfkoxml\",\"type\":\"hktuidvrma\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SavedSearchesListResult response = manager.savedSearches() - .listByWorkspaceWithResponse("xhpdulontacnpqwt", "htuevrhrljy", com.azure.core.util.Context.NONE) + .listByWorkspaceWithResponse("vvpa", "eksgbuxantuygd", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("xh", response.value().get(0).etag()); - Assertions.assertEquals("sd", response.value().get(0).category()); - Assertions.assertEquals("ugwbsreurfqkf", response.value().get(0).displayName()); - Assertions.assertEquals("arenlvhhtklnvnaf", response.value().get(0).query()); - Assertions.assertEquals("kyfede", response.value().get(0).functionAlias()); - Assertions.assertEquals("bo", response.value().get(0).functionParameters()); - Assertions.assertEquals(5433915956599731708L, response.value().get(0).version()); - Assertions.assertEquals("p", response.value().get(0).tags().get(0).name()); - Assertions.assertEquals("kkhminqcymczngn", response.value().get(0).tags().get(0).value()); + Assertions.assertEquals("i", response.value().get(0).etag()); + Assertions.assertEquals("irpiwrqofulopmj", response.value().get(0).category()); + Assertions.assertEquals("lexwhcbjp", response.value().get(0).displayName()); + Assertions.assertEquals("bke", response.value().get(0).query()); + Assertions.assertEquals("uuuercta", response.value().get(0).functionAlias()); + Assertions.assertEquals("yintqpbrlcy", response.value().get(0).functionParameters()); + Assertions.assertEquals(5915975308764094349L, response.value().get(0).version()); + Assertions.assertEquals("go", response.value().get(0).tags().get(0).name()); + Assertions.assertEquals("xyf", response.value().get(0).tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java index ba62da5bddc0..c21dae16b4ed 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SavedSearchesListResultInnerTests.java @@ -15,69 +15,49 @@ public final class SavedSearchesListResultInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SavedSearchesListResultInner model = BinaryData.fromString( - "{\"value\":[{\"etag\":\"abnetshh\",\"properties\":{\"category\":\"zhedplvwiw\",\"displayName\":\"bmwmbesldnkw\",\"query\":\"tppjflcx\",\"functionAlias\":\"aokonzmnsik\",\"functionParameters\":\"kqze\",\"version\":4891735483783264620,\"tags\":[{\"name\":\"fzxmhhvhgureodkw\",\"value\":\"bdagxt\"}]},\"id\":\"bqdxbx\",\"name\":\"akbogqxndlkzgxh\",\"type\":\"ripl\"},{\"etag\":\"odxun\",\"properties\":{\"category\":\"bebxmubyyntwl\",\"displayName\":\"bqtkoievseotgqr\",\"query\":\"ltmuwlauwzizx\",\"functionAlias\":\"pgcjefuzmuvp\",\"functionParameters\":\"tdum\",\"version\":411911013999749991,\"tags\":[{\"name\":\"bmnzbtbhjpgl\",\"value\":\"fgohdneuelfphs\"},{\"name\":\"yhtozfikdowwqu\",\"value\":\"v\"},{\"name\":\"zx\",\"value\":\"lvithhqzonosgg\"},{\"name\":\"hcohfwdsjnk\",\"value\":\"ljuti\"}]},\"id\":\"swacffgdkzz\",\"name\":\"wkfvhqcrailvp\",\"type\":\"ppfufl\"},{\"etag\":\"dmhdlxyjr\",\"properties\":{\"category\":\"sag\",\"displayName\":\"fcnihgwq\",\"query\":\"pnedgf\",\"functionAlias\":\"vkcvqvpkeqd\",\"functionParameters\":\"drhvoodsotbo\",\"version\":596884672630210595,\"tags\":[{\"name\":\"j\",\"value\":\"vnhdldwmgxcxr\"},{\"name\":\"lpmutwuoegrpkhj\",\"value\":\"niyqslui\"}]},\"id\":\"pdggkzzlvm\",\"name\":\"mpaxmodfvuefywsb\",\"type\":\"fvmwy\"},{\"etag\":\"fouyf\",\"properties\":{\"category\":\"aakc\",\"displayName\":\"wiyzvqtmnubexkp\",\"query\":\"ksmond\",\"functionAlias\":\"quxvypomgkop\",\"functionParameters\":\"hojvpajqgxysmocm\",\"version\":3563158574762399534,\"tags\":[{\"name\":\"kcxozapvhelx\",\"value\":\"rgly\"},{\"name\":\"tddckcb\",\"value\":\"uejrjxgc\"},{\"name\":\"qibrhosxsdqrhzoy\",\"value\":\"i\"}]},\"id\":\"m\",\"name\":\"qyib\",\"type\":\"hwflu\"}]}") + "{\"value\":[{\"etag\":\"xcto\",\"properties\":{\"category\":\"gbkdmoizpos\",\"displayName\":\"mgrcfbu\",\"query\":\"rmfqjhhkxbpvj\",\"functionAlias\":\"jhxxjyn\",\"functionParameters\":\"divkrt\",\"version\":4478371279557844955,\"tags\":[{\"name\":\"vszjfauvjfdxxi\",\"value\":\"e\"},{\"name\":\"vtcqaqtdo\",\"value\":\"mcbxvwvxysl\"}]},\"id\":\"bhsfxob\",\"name\":\"ytkblmpew\",\"type\":\"wfbkrvrns\"},{\"etag\":\"hqjohxcrsbfova\",\"properties\":{\"category\":\"rruvwbhsq\",\"displayName\":\"sub\",\"query\":\"gjb\",\"functionAlias\":\"xb\",\"functionParameters\":\"bsrfbj\",\"version\":3597217556472938019,\"tags\":[{\"name\":\"otftpvjzbexilz\",\"value\":\"nfqqnvwp\"},{\"name\":\"qtaruoujmkcjhwq\",\"value\":\"tjrybnwjewgdr\"}]},\"id\":\"ervnaenqpehi\",\"name\":\"doy\",\"type\":\"mifthnzdnd\"}]}") .toObject(SavedSearchesListResultInner.class); - Assertions.assertEquals("abnetshh", model.value().get(0).etag()); - Assertions.assertEquals("zhedplvwiw", model.value().get(0).category()); - Assertions.assertEquals("bmwmbesldnkw", model.value().get(0).displayName()); - Assertions.assertEquals("tppjflcx", model.value().get(0).query()); - Assertions.assertEquals("aokonzmnsik", model.value().get(0).functionAlias()); - Assertions.assertEquals("kqze", model.value().get(0).functionParameters()); - Assertions.assertEquals(4891735483783264620L, model.value().get(0).version()); - Assertions.assertEquals("fzxmhhvhgureodkw", model.value().get(0).tags().get(0).name()); - Assertions.assertEquals("bdagxt", model.value().get(0).tags().get(0).value()); + Assertions.assertEquals("xcto", model.value().get(0).etag()); + Assertions.assertEquals("gbkdmoizpos", model.value().get(0).category()); + Assertions.assertEquals("mgrcfbu", model.value().get(0).displayName()); + Assertions.assertEquals("rmfqjhhkxbpvj", model.value().get(0).query()); + Assertions.assertEquals("jhxxjyn", model.value().get(0).functionAlias()); + Assertions.assertEquals("divkrt", model.value().get(0).functionParameters()); + Assertions.assertEquals(4478371279557844955L, model.value().get(0).version()); + Assertions.assertEquals("vszjfauvjfdxxi", model.value().get(0).tags().get(0).name()); + Assertions.assertEquals("e", model.value().get(0).tags().get(0).value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { SavedSearchesListResultInner model = new SavedSearchesListResultInner().withValue(Arrays.asList( - new SavedSearchInner().withEtag("abnetshh") - .withCategory("zhedplvwiw") - .withDisplayName("bmwmbesldnkw") - .withQuery("tppjflcx") - .withFunctionAlias("aokonzmnsik") - .withFunctionParameters("kqze") - .withVersion(4891735483783264620L) - .withTags(Arrays.asList(new Tag().withName("fzxmhhvhgureodkw").withValue("bdagxt"))), - new SavedSearchInner().withEtag("odxun") - .withCategory("bebxmubyyntwl") - .withDisplayName("bqtkoievseotgqr") - .withQuery("ltmuwlauwzizx") - .withFunctionAlias("pgcjefuzmuvp") - .withFunctionParameters("tdum") - .withVersion(411911013999749991L) - .withTags(Arrays.asList(new Tag().withName("bmnzbtbhjpgl").withValue("fgohdneuelfphs"), - new Tag().withName("yhtozfikdowwqu").withValue("v"), - new Tag().withName("zx").withValue("lvithhqzonosgg"), - new Tag().withName("hcohfwdsjnk").withValue("ljuti"))), - new SavedSearchInner().withEtag("dmhdlxyjr") - .withCategory("sag") - .withDisplayName("fcnihgwq") - .withQuery("pnedgf") - .withFunctionAlias("vkcvqvpkeqd") - .withFunctionParameters("drhvoodsotbo") - .withVersion(596884672630210595L) - .withTags(Arrays.asList(new Tag().withName("j").withValue("vnhdldwmgxcxr"), - new Tag().withName("lpmutwuoegrpkhj").withValue("niyqslui"))), - new SavedSearchInner().withEtag("fouyf") - .withCategory("aakc") - .withDisplayName("wiyzvqtmnubexkp") - .withQuery("ksmond") - .withFunctionAlias("quxvypomgkop") - .withFunctionParameters("hojvpajqgxysmocm") - .withVersion(3563158574762399534L) - .withTags(Arrays.asList(new Tag().withName("kcxozapvhelx").withValue("rgly"), - new Tag().withName("tddckcb").withValue("uejrjxgc"), - new Tag().withName("qibrhosxsdqrhzoy").withValue("i"))))); + new SavedSearchInner().withEtag("xcto") + .withCategory("gbkdmoizpos") + .withDisplayName("mgrcfbu") + .withQuery("rmfqjhhkxbpvj") + .withFunctionAlias("jhxxjyn") + .withFunctionParameters("divkrt") + .withVersion(4478371279557844955L) + .withTags(Arrays.asList(new Tag().withName("vszjfauvjfdxxi").withValue("e"), + new Tag().withName("vtcqaqtdo").withValue("mcbxvwvxysl"))), + new SavedSearchInner().withEtag("hqjohxcrsbfova") + .withCategory("rruvwbhsq") + .withDisplayName("sub") + .withQuery("gjb") + .withFunctionAlias("xb") + .withFunctionParameters("bsrfbj") + .withVersion(3597217556472938019L) + .withTags(Arrays.asList(new Tag().withName("otftpvjzbexilz").withValue("nfqqnvwp"), + new Tag().withName("qtaruoujmkcjhwq").withValue("tjrybnwjewgdr"))))); model = BinaryData.fromObject(model).toObject(SavedSearchesListResultInner.class); - Assertions.assertEquals("abnetshh", model.value().get(0).etag()); - Assertions.assertEquals("zhedplvwiw", model.value().get(0).category()); - Assertions.assertEquals("bmwmbesldnkw", model.value().get(0).displayName()); - Assertions.assertEquals("tppjflcx", model.value().get(0).query()); - Assertions.assertEquals("aokonzmnsik", model.value().get(0).functionAlias()); - Assertions.assertEquals("kqze", model.value().get(0).functionParameters()); - Assertions.assertEquals(4891735483783264620L, model.value().get(0).version()); - Assertions.assertEquals("fzxmhhvhgureodkw", model.value().get(0).tags().get(0).name()); - Assertions.assertEquals("bdagxt", model.value().get(0).tags().get(0).value()); + Assertions.assertEquals("xcto", model.value().get(0).etag()); + Assertions.assertEquals("gbkdmoizpos", model.value().get(0).category()); + Assertions.assertEquals("mgrcfbu", model.value().get(0).displayName()); + Assertions.assertEquals("rmfqjhhkxbpvj", model.value().get(0).query()); + Assertions.assertEquals("jhxxjyn", model.value().get(0).functionAlias()); + Assertions.assertEquals("divkrt", model.value().get(0).functionParameters()); + Assertions.assertEquals(4478371279557844955L, model.value().get(0).version()); + Assertions.assertEquals("vszjfauvjfdxxi", model.value().get(0).tags().get(0).name()); + Assertions.assertEquals("e", model.value().get(0).tags().get(0).value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java index 4b0668991e30..f0a4da19d385 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemaTests.java @@ -16,42 +16,42 @@ public final class SchemaTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { Schema model = BinaryData.fromString( - "{\"name\":\"r\",\"displayName\":\"ukiscvwmzhw\",\"description\":\"efaxvxilc\",\"columns\":[{\"name\":\"hnze\",\"type\":\"guid\",\"dataTypeHint\":\"ip\",\"displayName\":\"fzqlqhycavod\",\"description\":\"xdbeesmieknl\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"wiuagydwqf\",\"type\":\"int\",\"dataTypeHint\":\"uri\",\"displayName\":\"giagtcojo\",\"description\":\"wogfnzjvu\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"uxylfsbtkadpy\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"gkbugrjqct\",\"description\":\"cmisofie\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"yqdhcuplcplcw\",\"type\":\"int\",\"dataTypeHint\":\"armPath\",\"displayName\":\"lhzdsqtzb\",\"description\":\"gnowcjhfgmveca\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"teyowclu\",\"type\":\"real\",\"dataTypeHint\":\"guid\",\"displayName\":\"vgqouwifzmpj\",\"description\":\"ivqikfxcvhr\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"grttikteusqczk\",\"type\":\"real\",\"dataTypeHint\":\"ip\",\"displayName\":\"byjaffmmf\",\"description\":\"cqc\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"categories\":[\"rtalmet\"],\"labels\":[\"gdslqxihhrmoo\",\"z\"],\"source\":\"customer\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"cxa\",\"zhyrpeto\",\"e\",\"joxslhvnhla\"]}") + "{\"name\":\"xnavvwxq\",\"displayName\":\"y\",\"description\":\"nyowxwlmdjrkvfg\",\"columns\":[{\"name\":\"p\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"izsjqlhkrr\",\"description\":\"deibqip\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"ndzwmkrefa\",\"type\":\"guid\",\"dataTypeHint\":\"uri\",\"displayName\":\"kqnyh\",\"description\":\"ij\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"standardColumns\":[{\"name\":\"jabibsystawf\",\"type\":\"dynamic\",\"dataTypeHint\":\"uri\",\"displayName\":\"vp\",\"description\":\"xbkzbzkdvncj\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"categories\":[\"kakmokzh\",\"jk\",\"ffhmouwqlgzr\",\"zeeyebi\"],\"labels\":[\"ayuhqlbjbsy\",\"bqwrvtldgm\",\"pgvmpipaslthaqfx\"],\"source\":\"customer\",\"tableType\":\"Microsoft\",\"tableSubType\":\"Classic\",\"solutions\":[\"srezp\",\"rhneuyowq\",\"d\",\"ytisibir\"]}") .toObject(Schema.class); - Assertions.assertEquals("r", model.name()); - Assertions.assertEquals("ukiscvwmzhw", model.displayName()); - Assertions.assertEquals("efaxvxilc", model.description()); - Assertions.assertEquals("hnze", model.columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.GUID, model.columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.IP, model.columns().get(0).dataTypeHint()); - Assertions.assertEquals("fzqlqhycavod", model.columns().get(0).displayName()); - Assertions.assertEquals("xdbeesmieknl", model.columns().get(0).description()); + Assertions.assertEquals("xnavvwxq", model.name()); + Assertions.assertEquals("y", model.displayName()); + Assertions.assertEquals("nyowxwlmdjrkvfg", model.description()); + Assertions.assertEquals("p", model.columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.REAL, model.columns().get(0).type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.ARM_PATH, model.columns().get(0).dataTypeHint()); + Assertions.assertEquals("izsjqlhkrr", model.columns().get(0).displayName()); + Assertions.assertEquals("deibqip", model.columns().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Schema model = new Schema().withName("r") - .withDisplayName("ukiscvwmzhw") - .withDescription("efaxvxilc") + Schema model = new Schema().withName("xnavvwxq") + .withDisplayName("y") + .withDescription("nyowxwlmdjrkvfg") .withColumns(Arrays.asList( - new Column().withName("hnze") + new Column().withName("p") + .withType(ColumnTypeEnum.REAL) + .withDataTypeHint(ColumnDataTypeHintEnum.ARM_PATH) + .withDisplayName("izsjqlhkrr") + .withDescription("deibqip"), + new Column().withName("ndzwmkrefa") .withType(ColumnTypeEnum.GUID) - .withDataTypeHint(ColumnDataTypeHintEnum.IP) - .withDisplayName("fzqlqhycavod") - .withDescription("xdbeesmieknl"), - new Column().withName("wiuagydwqf") - .withType(ColumnTypeEnum.INT) .withDataTypeHint(ColumnDataTypeHintEnum.URI) - .withDisplayName("giagtcojo") - .withDescription("wogfnzjvu"))); + .withDisplayName("kqnyh") + .withDescription("ij"))); model = BinaryData.fromObject(model).toObject(Schema.class); - Assertions.assertEquals("r", model.name()); - Assertions.assertEquals("ukiscvwmzhw", model.displayName()); - Assertions.assertEquals("efaxvxilc", model.description()); - Assertions.assertEquals("hnze", model.columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.GUID, model.columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.IP, model.columns().get(0).dataTypeHint()); - Assertions.assertEquals("fzqlqhycavod", model.columns().get(0).displayName()); - Assertions.assertEquals("xdbeesmieknl", model.columns().get(0).description()); + Assertions.assertEquals("xnavvwxq", model.name()); + Assertions.assertEquals("y", model.displayName()); + Assertions.assertEquals("nyowxwlmdjrkvfg", model.description()); + Assertions.assertEquals("p", model.columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.REAL, model.columns().get(0).type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.ARM_PATH, model.columns().get(0).dataTypeHint()); + Assertions.assertEquals("izsjqlhkrr", model.columns().get(0).displayName()); + Assertions.assertEquals("deibqip", model.columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java index 8116903943b4..f768497bb26e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SchemasGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.SearchGetSchemaResponse; @@ -22,44 +22,44 @@ public final class SchemasGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"metadata\":{\"requestId\":\"lg\",\"resultType\":\"txd\",\"total\":7982443333722102241,\"top\":2221953429879798985,\"id\":\"zvlnsnnjz\",\"coreSummaries\":[{\"status\":\"olpy\",\"numberOfDocuments\":117086894031994632},{\"status\":\"xqzragp\",\"numberOfDocuments\":5124334742263421163},{\"status\":\"t\",\"numberOfDocuments\":5064204054792112038},{\"status\":\"a\",\"numberOfDocuments\":1817616718311848555}],\"status\":\"jchcsrlzknmzla\",\"startTime\":\"2021-01-20T21:47:05Z\",\"lastUpdated\":\"2021-11-08T10:57:25Z\",\"eTag\":\"vnphc\",\"sort\":[{\"name\":\"pjhmqrhvthl\",\"order\":\"desc\"}],\"requestTime\":1106480050332233961,\"aggregatedValueField\":\"mlzzhzdtxetlgyd\",\"aggregatedGroupingFields\":\"qvlnnpxybafiqgea\",\"sum\":3246800772078835427,\"max\":7730272397217059241,\"schema\":{\"name\":\"klbyulidwcw\",\"version\":1795651624}},\"value\":[{\"name\":\"o\",\"displayName\":\"hj\",\"type\":\"wgdnqzbr\",\"indexed\":true,\"stored\":true,\"facet\":false,\"ownerType\":[\"zmtksjci\",\"digsxcdgl\"]}]}"; + = "{\"metadata\":{\"requestId\":\"hrweftkw\",\"resultType\":\"jp\",\"total\":2377130180811265800,\"top\":3632648174501059306,\"id\":\"pwamcxtczhupeuk\",\"coreSummaries\":[{\"status\":\"uyyes\",\"numberOfDocuments\":5177486878531490465},{\"status\":\"fbocyvhh\",\"numberOfDocuments\":7086241339877476619},{\"status\":\"ywikd\",\"numberOfDocuments\":1557781167596850119},{\"status\":\"kuflgbh\",\"numberOfDocuments\":6099044169152299925}],\"status\":\"cdixmx\",\"startTime\":\"2021-07-21T10:11:29Z\",\"lastUpdated\":\"2021-10-28T11:16:26Z\",\"eTag\":\"jqgdkfnozoeo\",\"sort\":[{\"name\":\"h\",\"order\":\"asc\"},{\"name\":\"wbmqjchntas\",\"order\":\"desc\"},{\"name\":\"xbulpzealbmqkyo\",\"order\":\"asc\"}],\"requestTime\":6096246762150938167,\"aggregatedValueField\":\"btsuahxs\",\"aggregatedGroupingFields\":\"jcmmzrrscub\",\"sum\":1482066446768394569,\"max\":9101534338635329443,\"schema\":{\"name\":\"wodiffjxc\",\"version\":1719649030}},\"value\":[{\"name\":\"bwi\",\"displayName\":\"jogjonmc\",\"type\":\"foyzbamwineof\",\"indexed\":false,\"stored\":false,\"facet\":true,\"ownerType\":[\"oldtvevboclzhz\"]},{\"name\":\"n\",\"displayName\":\"xgvttxp\",\"type\":\"upzaamrdixtre\",\"indexed\":false,\"stored\":false,\"facet\":true,\"ownerType\":[\"skbruffgllukkut\",\"lxhrp\"]},{\"name\":\"vmblcouqe\",\"displayName\":\"hbcdsziry\",\"type\":\"ndo\",\"indexed\":true,\"stored\":false,\"facet\":false,\"ownerType\":[\"oormkfqlwxldyka\"]}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); SearchGetSchemaResponse response - = manager.schemas().getWithResponse("cdxfzzzwyjafitl", "guyn", com.azure.core.util.Context.NONE).getValue(); + = manager.schemas().getWithResponse("llizs", "ac", com.azure.core.util.Context.NONE).getValue(); - Assertions.assertEquals("lg", response.metadata().searchId()); - Assertions.assertEquals("txd", response.metadata().resultType()); - Assertions.assertEquals(7982443333722102241L, response.metadata().total()); - Assertions.assertEquals(2221953429879798985L, response.metadata().top()); - Assertions.assertEquals("zvlnsnnjz", response.metadata().id()); - Assertions.assertEquals("olpy", response.metadata().coreSummaries().get(0).status()); - Assertions.assertEquals(117086894031994632L, response.metadata().coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("jchcsrlzknmzla", response.metadata().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-20T21:47:05Z"), response.metadata().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-08T10:57:25Z"), response.metadata().lastUpdated()); - Assertions.assertEquals("vnphc", response.metadata().etag()); - Assertions.assertEquals("pjhmqrhvthl", response.metadata().sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.DESC, response.metadata().sort().get(0).order()); - Assertions.assertEquals(1106480050332233961L, response.metadata().requestTime()); - Assertions.assertEquals("mlzzhzdtxetlgyd", response.metadata().aggregatedValueField()); - Assertions.assertEquals("qvlnnpxybafiqgea", response.metadata().aggregatedGroupingFields()); - Assertions.assertEquals(3246800772078835427L, response.metadata().sum()); - Assertions.assertEquals(7730272397217059241L, response.metadata().max()); - Assertions.assertEquals("klbyulidwcw", response.metadata().schema().name()); - Assertions.assertEquals(1795651624, response.metadata().schema().version()); - Assertions.assertEquals("o", response.value().get(0).name()); - Assertions.assertEquals("hj", response.value().get(0).displayName()); - Assertions.assertEquals("wgdnqzbr", response.value().get(0).type()); - Assertions.assertEquals(true, response.value().get(0).indexed()); - Assertions.assertEquals(true, response.value().get(0).stored()); - Assertions.assertEquals(false, response.value().get(0).facet()); - Assertions.assertEquals("zmtksjci", response.value().get(0).ownerType().get(0)); + Assertions.assertEquals("hrweftkw", response.metadata().searchId()); + Assertions.assertEquals("jp", response.metadata().resultType()); + Assertions.assertEquals(2377130180811265800L, response.metadata().total()); + Assertions.assertEquals(3632648174501059306L, response.metadata().top()); + Assertions.assertEquals("pwamcxtczhupeuk", response.metadata().id()); + Assertions.assertEquals("uyyes", response.metadata().coreSummaries().get(0).status()); + Assertions.assertEquals(5177486878531490465L, response.metadata().coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("cdixmx", response.metadata().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-21T10:11:29Z"), response.metadata().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-28T11:16:26Z"), response.metadata().lastUpdated()); + Assertions.assertEquals("jqgdkfnozoeo", response.metadata().etag()); + Assertions.assertEquals("h", response.metadata().sort().get(0).name()); + Assertions.assertEquals(SearchSortEnum.ASC, response.metadata().sort().get(0).order()); + Assertions.assertEquals(6096246762150938167L, response.metadata().requestTime()); + Assertions.assertEquals("btsuahxs", response.metadata().aggregatedValueField()); + Assertions.assertEquals("jcmmzrrscub", response.metadata().aggregatedGroupingFields()); + Assertions.assertEquals(1482066446768394569L, response.metadata().sum()); + Assertions.assertEquals(9101534338635329443L, response.metadata().max()); + Assertions.assertEquals("wodiffjxc", response.metadata().schema().name()); + Assertions.assertEquals(1719649030, response.metadata().schema().version()); + Assertions.assertEquals("bwi", response.value().get(0).name()); + Assertions.assertEquals("jogjonmc", response.value().get(0).displayName()); + Assertions.assertEquals("foyzbamwineof", response.value().get(0).type()); + Assertions.assertFalse(response.value().get(0).indexed()); + Assertions.assertFalse(response.value().get(0).stored()); + Assertions.assertTrue(response.value().get(0).facet()); + Assertions.assertEquals("oldtvevboclzhz", response.value().get(0).ownerType().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java index 216dfe67397e..6c61eb99fb6b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchGetSchemaResponseInnerTests.java @@ -20,119 +20,113 @@ public final class SearchGetSchemaResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SearchGetSchemaResponseInner model = BinaryData.fromString( - "{\"metadata\":{\"requestId\":\"enwash\",\"resultType\":\"dtkcnqxwbpokulp\",\"total\":4256703090352932350,\"top\":8748295195867506861,\"id\":\"pqiiobyuqe\",\"coreSummaries\":[{\"status\":\"pqwcciuqgbdbutau\",\"numberOfDocuments\":4381546425309848486},{\"status\":\"kuwhh\",\"numberOfDocuments\":8532271889690426142},{\"status\":\"ojoxafnndlp\",\"numberOfDocuments\":3311442512942014453}],\"status\":\"o\",\"startTime\":\"2021-07-02T22:41:48Z\",\"lastUpdated\":\"2021-10-22T11:40:28Z\",\"eTag\":\"h\",\"sort\":[{\"name\":\"pwdreqnovvqf\",\"order\":\"asc\"},{\"name\":\"xywsuws\",\"order\":\"asc\"},{\"name\":\"dsytgadgvr\",\"order\":\"desc\"},{\"name\":\"neqn\",\"order\":\"desc\"}],\"requestTime\":5080605539580294993,\"aggregatedValueField\":\"uu\",\"aggregatedGroupingFields\":\"fqka\",\"sum\":8183486072070109381,\"max\":1237347078053939435,\"schema\":{\"name\":\"bjibwwiftohq\",\"version\":1205462118}},\"value\":[{\"name\":\"sgplsakn\",\"displayName\":\"fsynljphuop\",\"type\":\"dlqiyntorzih\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"w\",\"rmslyzrpzbchckqq\"]},{\"name\":\"ioxiysuiizyn\",\"displayName\":\"dy\",\"type\":\"rwyhqmibzyhwitsm\",\"indexed\":false,\"stored\":true,\"facet\":true,\"ownerType\":[\"cdpu\",\"nzgmwznmabik\"]},{\"name\":\"orgjhxbldt\",\"displayName\":\"wrlkdmtn\",\"type\":\"ok\",\"indexed\":true,\"stored\":false,\"facet\":false,\"ownerType\":[\"yhgsy\"]},{\"name\":\"ogjltdtbnnhad\",\"displayName\":\"crkvcikhnv\",\"type\":\"mqg\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"ik\",\"wggxkallat\"]}]}") + "{\"metadata\":{\"requestId\":\"nayqi\",\"resultType\":\"nduhavhqlkthum\",\"total\":8390013026245928421,\"top\":5649591766559477880,\"id\":\"duiertgcc\",\"coreSummaries\":[{\"status\":\"olpsslqlf\",\"numberOfDocuments\":5488709340385622129},{\"status\":\"bbglzpswiydmc\",\"numberOfDocuments\":2535246333551569384},{\"status\":\"dxssadbzm\",\"numberOfDocuments\":6861155578766594130}],\"status\":\"znud\",\"startTime\":\"2021-05-14T14:21:36Z\",\"lastUpdated\":\"2021-09-27T09:43:19Z\",\"eTag\":\"bncblylpstdbhhx\",\"sort\":[{\"name\":\"zucerscdntnev\",\"order\":\"asc\"},{\"name\":\"mygtdssls\",\"order\":\"desc\"},{\"name\":\"eriofzpyqs\",\"order\":\"asc\"},{\"name\":\"bnetshh\",\"order\":\"asc\"}],\"requestTime\":87133014421625826,\"aggregatedValueField\":\"vwiwubmwmbesld\",\"aggregatedGroupingFields\":\"wwtppj\",\"sum\":3431932886317561144,\"max\":5668149621351966733,\"schema\":{\"name\":\"onz\",\"version\":1813308851}},\"value\":[{\"name\":\"mkqzeqqkdltfzxmh\",\"displayName\":\"hgure\",\"type\":\"kwobdagxtibq\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"kbogqxndlkzgx\",\"uriplbpodxunkb\",\"bxmubyynt\",\"lrb\"]},{\"name\":\"koievseo\",\"displayName\":\"q\",\"type\":\"ltmuwlauwzizx\",\"indexed\":true,\"stored\":true,\"facet\":false,\"ownerType\":[\"efuzmuvpbttd\",\"morppxebmnzbtbh\",\"pglkf\",\"ohdneuel\"]},{\"name\":\"hsd\",\"displayName\":\"t\",\"type\":\"fikdowwqu\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"lvithhqzonosgg\",\"hcohfwdsjnk\"]}]}") .toObject(SearchGetSchemaResponseInner.class); - Assertions.assertEquals("enwash", model.metadata().searchId()); - Assertions.assertEquals("dtkcnqxwbpokulp", model.metadata().resultType()); - Assertions.assertEquals(4256703090352932350L, model.metadata().total()); - Assertions.assertEquals(8748295195867506861L, model.metadata().top()); - Assertions.assertEquals("pqiiobyuqe", model.metadata().id()); - Assertions.assertEquals("pqwcciuqgbdbutau", model.metadata().coreSummaries().get(0).status()); - Assertions.assertEquals(4381546425309848486L, model.metadata().coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("o", model.metadata().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-02T22:41:48Z"), model.metadata().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T11:40:28Z"), model.metadata().lastUpdated()); - Assertions.assertEquals("h", model.metadata().etag()); - Assertions.assertEquals("pwdreqnovvqf", model.metadata().sort().get(0).name()); + Assertions.assertEquals("nayqi", model.metadata().searchId()); + Assertions.assertEquals("nduhavhqlkthum", model.metadata().resultType()); + Assertions.assertEquals(8390013026245928421L, model.metadata().total()); + Assertions.assertEquals(5649591766559477880L, model.metadata().top()); + Assertions.assertEquals("duiertgcc", model.metadata().id()); + Assertions.assertEquals("olpsslqlf", model.metadata().coreSummaries().get(0).status()); + Assertions.assertEquals(5488709340385622129L, model.metadata().coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("znud", model.metadata().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T14:21:36Z"), model.metadata().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T09:43:19Z"), model.metadata().lastUpdated()); + Assertions.assertEquals("bncblylpstdbhhx", model.metadata().etag()); + Assertions.assertEquals("zucerscdntnev", model.metadata().sort().get(0).name()); Assertions.assertEquals(SearchSortEnum.ASC, model.metadata().sort().get(0).order()); - Assertions.assertEquals(5080605539580294993L, model.metadata().requestTime()); - Assertions.assertEquals("uu", model.metadata().aggregatedValueField()); - Assertions.assertEquals("fqka", model.metadata().aggregatedGroupingFields()); - Assertions.assertEquals(8183486072070109381L, model.metadata().sum()); - Assertions.assertEquals(1237347078053939435L, model.metadata().max()); - Assertions.assertEquals("bjibwwiftohq", model.metadata().schema().name()); - Assertions.assertEquals(1205462118, model.metadata().schema().version()); - Assertions.assertEquals("sgplsakn", model.value().get(0).name()); - Assertions.assertEquals("fsynljphuop", model.value().get(0).displayName()); - Assertions.assertEquals("dlqiyntorzih", model.value().get(0).type()); - Assertions.assertEquals(false, model.value().get(0).indexed()); - Assertions.assertEquals(false, model.value().get(0).stored()); - Assertions.assertEquals(false, model.value().get(0).facet()); - Assertions.assertEquals("w", model.value().get(0).ownerType().get(0)); + Assertions.assertEquals(87133014421625826L, model.metadata().requestTime()); + Assertions.assertEquals("vwiwubmwmbesld", model.metadata().aggregatedValueField()); + Assertions.assertEquals("wwtppj", model.metadata().aggregatedGroupingFields()); + Assertions.assertEquals(3431932886317561144L, model.metadata().sum()); + Assertions.assertEquals(5668149621351966733L, model.metadata().max()); + Assertions.assertEquals("onz", model.metadata().schema().name()); + Assertions.assertEquals(1813308851, model.metadata().schema().version()); + Assertions.assertEquals("mkqzeqqkdltfzxmh", model.value().get(0).name()); + Assertions.assertEquals("hgure", model.value().get(0).displayName()); + Assertions.assertEquals("kwobdagxtibq", model.value().get(0).type()); + Assertions.assertFalse(model.value().get(0).indexed()); + Assertions.assertFalse(model.value().get(0).stored()); + Assertions.assertFalse(model.value().get(0).facet()); + Assertions.assertEquals("kbogqxndlkzgx", model.value().get(0).ownerType().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchGetSchemaResponseInner model = new SearchGetSchemaResponseInner() - .withMetadata(new SearchMetadata().withSearchId("enwash") - .withResultType("dtkcnqxwbpokulp") - .withTotal(4256703090352932350L) - .withTop(8748295195867506861L) - .withId("pqiiobyuqe") - .withCoreSummaries(Arrays.asList( - new CoreSummary().withStatus("pqwcciuqgbdbutau").withNumberOfDocuments(4381546425309848486L), - new CoreSummary().withStatus("kuwhh").withNumberOfDocuments(8532271889690426142L), - new CoreSummary().withStatus("ojoxafnndlp").withNumberOfDocuments(3311442512942014453L))) - .withStatus("o") - .withStartTime(OffsetDateTime.parse("2021-07-02T22:41:48Z")) - .withLastUpdated(OffsetDateTime.parse("2021-10-22T11:40:28Z")) - .withEtag("h") - .withSort(Arrays.asList(new SearchSort().withName("pwdreqnovvqf").withOrder(SearchSortEnum.ASC), - new SearchSort().withName("xywsuws").withOrder(SearchSortEnum.ASC), - new SearchSort().withName("dsytgadgvr").withOrder(SearchSortEnum.DESC), - new SearchSort().withName("neqn").withOrder(SearchSortEnum.DESC))) - .withRequestTime(5080605539580294993L) - .withAggregatedValueField("uu") - .withAggregatedGroupingFields("fqka") - .withSum(8183486072070109381L) - .withMax(1237347078053939435L) - .withSchema(new SearchMetadataSchema().withName("bjibwwiftohq").withVersion(1205462118))) - .withValue(Arrays.asList( - new SearchSchemaValue().withName("sgplsakn") - .withDisplayName("fsynljphuop") - .withType("dlqiyntorzih") - .withIndexed(false) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("w", "rmslyzrpzbchckqq")), - new SearchSchemaValue().withName("ioxiysuiizyn") - .withDisplayName("dy") - .withType("rwyhqmibzyhwitsm") - .withIndexed(false) - .withStored(true) - .withFacet(true) - .withOwnerType(Arrays.asList("cdpu", "nzgmwznmabik")), - new SearchSchemaValue().withName("orgjhxbldt") - .withDisplayName("wrlkdmtn") - .withType("ok") - .withIndexed(true) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("yhgsy")), - new SearchSchemaValue().withName("ogjltdtbnnhad") - .withDisplayName("crkvcikhnv") - .withType("mqg") - .withIndexed(false) - .withStored(false) - .withFacet(false) - .withOwnerType(Arrays.asList("ik", "wggxkallat")))); + SearchGetSchemaResponseInner model + = new SearchGetSchemaResponseInner() + .withMetadata(new SearchMetadata().withSearchId("nayqi") + .withResultType("nduhavhqlkthum") + .withTotal(8390013026245928421L) + .withTop(5649591766559477880L) + .withId("duiertgcc") + .withCoreSummaries(Arrays.asList( + new CoreSummary().withStatus("olpsslqlf").withNumberOfDocuments(5488709340385622129L), + new CoreSummary().withStatus("bbglzpswiydmc").withNumberOfDocuments(2535246333551569384L), + new CoreSummary().withStatus("dxssadbzm").withNumberOfDocuments(6861155578766594130L))) + .withStatus("znud") + .withStartTime(OffsetDateTime.parse("2021-05-14T14:21:36Z")) + .withLastUpdated(OffsetDateTime.parse("2021-09-27T09:43:19Z")) + .withEtag("bncblylpstdbhhx") + .withSort(Arrays.asList(new SearchSort().withName("zucerscdntnev").withOrder(SearchSortEnum.ASC), + new SearchSort().withName("mygtdssls").withOrder(SearchSortEnum.DESC), + new SearchSort().withName("eriofzpyqs").withOrder(SearchSortEnum.ASC), + new SearchSort().withName("bnetshh").withOrder(SearchSortEnum.ASC))) + .withRequestTime(87133014421625826L) + .withAggregatedValueField("vwiwubmwmbesld") + .withAggregatedGroupingFields("wwtppj") + .withSum(3431932886317561144L) + .withMax(5668149621351966733L) + .withSchema(new SearchMetadataSchema().withName("onz").withVersion(1813308851))) + .withValue(Arrays.asList( + new SearchSchemaValue().withName("mkqzeqqkdltfzxmh") + .withDisplayName("hgure") + .withType("kwobdagxtibq") + .withIndexed(false) + .withStored(false) + .withFacet(false) + .withOwnerType(Arrays.asList("kbogqxndlkzgx", "uriplbpodxunkb", "bxmubyynt", "lrb")), + new SearchSchemaValue().withName("koievseo") + .withDisplayName("q") + .withType("ltmuwlauwzizx") + .withIndexed(true) + .withStored(true) + .withFacet(false) + .withOwnerType(Arrays.asList("efuzmuvpbttd", "morppxebmnzbtbh", "pglkf", "ohdneuel")), + new SearchSchemaValue().withName("hsd") + .withDisplayName("t") + .withType("fikdowwqu") + .withIndexed(false) + .withStored(false) + .withFacet(false) + .withOwnerType(Arrays.asList("lvithhqzonosgg", "hcohfwdsjnk")))); model = BinaryData.fromObject(model).toObject(SearchGetSchemaResponseInner.class); - Assertions.assertEquals("enwash", model.metadata().searchId()); - Assertions.assertEquals("dtkcnqxwbpokulp", model.metadata().resultType()); - Assertions.assertEquals(4256703090352932350L, model.metadata().total()); - Assertions.assertEquals(8748295195867506861L, model.metadata().top()); - Assertions.assertEquals("pqiiobyuqe", model.metadata().id()); - Assertions.assertEquals("pqwcciuqgbdbutau", model.metadata().coreSummaries().get(0).status()); - Assertions.assertEquals(4381546425309848486L, model.metadata().coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("o", model.metadata().status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-02T22:41:48Z"), model.metadata().startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-22T11:40:28Z"), model.metadata().lastUpdated()); - Assertions.assertEquals("h", model.metadata().etag()); - Assertions.assertEquals("pwdreqnovvqf", model.metadata().sort().get(0).name()); + Assertions.assertEquals("nayqi", model.metadata().searchId()); + Assertions.assertEquals("nduhavhqlkthum", model.metadata().resultType()); + Assertions.assertEquals(8390013026245928421L, model.metadata().total()); + Assertions.assertEquals(5649591766559477880L, model.metadata().top()); + Assertions.assertEquals("duiertgcc", model.metadata().id()); + Assertions.assertEquals("olpsslqlf", model.metadata().coreSummaries().get(0).status()); + Assertions.assertEquals(5488709340385622129L, model.metadata().coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("znud", model.metadata().status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-14T14:21:36Z"), model.metadata().startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-27T09:43:19Z"), model.metadata().lastUpdated()); + Assertions.assertEquals("bncblylpstdbhhx", model.metadata().etag()); + Assertions.assertEquals("zucerscdntnev", model.metadata().sort().get(0).name()); Assertions.assertEquals(SearchSortEnum.ASC, model.metadata().sort().get(0).order()); - Assertions.assertEquals(5080605539580294993L, model.metadata().requestTime()); - Assertions.assertEquals("uu", model.metadata().aggregatedValueField()); - Assertions.assertEquals("fqka", model.metadata().aggregatedGroupingFields()); - Assertions.assertEquals(8183486072070109381L, model.metadata().sum()); - Assertions.assertEquals(1237347078053939435L, model.metadata().max()); - Assertions.assertEquals("bjibwwiftohq", model.metadata().schema().name()); - Assertions.assertEquals(1205462118, model.metadata().schema().version()); - Assertions.assertEquals("sgplsakn", model.value().get(0).name()); - Assertions.assertEquals("fsynljphuop", model.value().get(0).displayName()); - Assertions.assertEquals("dlqiyntorzih", model.value().get(0).type()); - Assertions.assertEquals(false, model.value().get(0).indexed()); - Assertions.assertEquals(false, model.value().get(0).stored()); - Assertions.assertEquals(false, model.value().get(0).facet()); - Assertions.assertEquals("w", model.value().get(0).ownerType().get(0)); + Assertions.assertEquals(87133014421625826L, model.metadata().requestTime()); + Assertions.assertEquals("vwiwubmwmbesld", model.metadata().aggregatedValueField()); + Assertions.assertEquals("wwtppj", model.metadata().aggregatedGroupingFields()); + Assertions.assertEquals(3431932886317561144L, model.metadata().sum()); + Assertions.assertEquals(5668149621351966733L, model.metadata().max()); + Assertions.assertEquals("onz", model.metadata().schema().name()); + Assertions.assertEquals(1813308851, model.metadata().schema().version()); + Assertions.assertEquals("mkqzeqqkdltfzxmh", model.value().get(0).name()); + Assertions.assertEquals("hgure", model.value().get(0).displayName()); + Assertions.assertEquals("kwobdagxtibq", model.value().get(0).type()); + Assertions.assertFalse(model.value().get(0).indexed()); + Assertions.assertFalse(model.value().get(0).stored()); + Assertions.assertFalse(model.value().get(0).facet()); + Assertions.assertEquals("kbogqxndlkzgx", model.value().get(0).ownerType().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java index eb39d2f3c679..e0ab265f0d2d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataSchemaTests.java @@ -11,17 +11,17 @@ public final class SearchMetadataSchemaTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SearchMetadataSchema model = BinaryData.fromString("{\"name\":\"jhwuaanozjos\",\"version\":1082355314}") + SearchMetadataSchema model = BinaryData.fromString("{\"name\":\"pomgkopkwhojvp\",\"version\":996289807}") .toObject(SearchMetadataSchema.class); - Assertions.assertEquals("jhwuaanozjos", model.name()); - Assertions.assertEquals(1082355314, model.version()); + Assertions.assertEquals("pomgkopkwhojvp", model.name()); + Assertions.assertEquals(996289807, model.version()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchMetadataSchema model = new SearchMetadataSchema().withName("jhwuaanozjos").withVersion(1082355314); + SearchMetadataSchema model = new SearchMetadataSchema().withName("pomgkopkwhojvp").withVersion(996289807); model = BinaryData.fromObject(model).toObject(SearchMetadataSchema.class); - Assertions.assertEquals("jhwuaanozjos", model.name()); - Assertions.assertEquals(1082355314, model.version()); + Assertions.assertEquals("pomgkopkwhojvp", model.name()); + Assertions.assertEquals(996289807, model.version()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java index d94203f802ab..fa74123b19f0 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchMetadataTests.java @@ -18,71 +18,74 @@ public final class SearchMetadataTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SearchMetadata model = BinaryData.fromString( - "{\"requestId\":\"lwuip\",\"resultType\":\"cjzkzivgvvcna\",\"total\":8913535749004515550,\"top\":5279516661370439683,\"id\":\"mueedndrdvstk\",\"coreSummaries\":[{\"status\":\"chea\",\"numberOfDocuments\":3646125258806158004}],\"status\":\"tdaaygdvwvg\",\"startTime\":\"2021-06-07T06:53:10Z\",\"lastUpdated\":\"2021-10-23T00:12:41Z\",\"eTag\":\"xrtfudxep\",\"sort\":[{\"name\":\"agvrvmnpkuk\",\"order\":\"asc\"},{\"name\":\"dblx\",\"order\":\"desc\"}],\"requestTime\":7611617377471579634,\"aggregatedValueField\":\"hfjx\",\"aggregatedGroupingFields\":\"szkkfoqre\",\"sum\":8338807266312513089,\"max\":2185206310902116436,\"schema\":{\"name\":\"wneaiv\",\"version\":322973840}}") + "{\"requestId\":\"jutiiswacff\",\"resultType\":\"k\",\"total\":2817316502996814580,\"top\":4896642944442173063,\"id\":\"qcrailvpnppfufl\",\"coreSummaries\":[{\"status\":\"hdlxyjrxsagafcn\",\"numberOfDocuments\":3165727782283367859},{\"status\":\"qapnedgfbcv\",\"numberOfDocuments\":3094759713825353725},{\"status\":\"vpk\",\"numberOfDocuments\":1489368232618160329}],\"status\":\"vdrhvoo\",\"startTime\":\"2021-11-10T16:13:32Z\",\"lastUpdated\":\"2021-11-02T01:53:07Z\",\"eTag\":\"bzdopcj\",\"sort\":[{\"name\":\"dldwmgxc\",\"order\":\"desc\"},{\"name\":\"pmutwuo\",\"order\":\"asc\"},{\"name\":\"khjwn\",\"order\":\"asc\"}],\"requestTime\":9145208048517339786,\"aggregatedValueField\":\"cpdggkzzlvmbmp\",\"aggregatedGroupingFields\":\"modfvuefywsbpfvm\",\"sum\":5583429102583863786,\"max\":98342047801553484,\"schema\":{\"name\":\"taakc\",\"version\":369562825}}") .toObject(SearchMetadata.class); - Assertions.assertEquals("lwuip", model.searchId()); - Assertions.assertEquals("cjzkzivgvvcna", model.resultType()); - Assertions.assertEquals(8913535749004515550L, model.total()); - Assertions.assertEquals(5279516661370439683L, model.top()); - Assertions.assertEquals("mueedndrdvstk", model.id()); - Assertions.assertEquals("chea", model.coreSummaries().get(0).status()); - Assertions.assertEquals(3646125258806158004L, model.coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("tdaaygdvwvg", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T06:53:10Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T00:12:41Z"), model.lastUpdated()); - Assertions.assertEquals("xrtfudxep", model.etag()); - Assertions.assertEquals("agvrvmnpkuk", model.sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.ASC, model.sort().get(0).order()); - Assertions.assertEquals(7611617377471579634L, model.requestTime()); - Assertions.assertEquals("hfjx", model.aggregatedValueField()); - Assertions.assertEquals("szkkfoqre", model.aggregatedGroupingFields()); - Assertions.assertEquals(8338807266312513089L, model.sum()); - Assertions.assertEquals(2185206310902116436L, model.max()); - Assertions.assertEquals("wneaiv", model.schema().name()); - Assertions.assertEquals(322973840, model.schema().version()); + Assertions.assertEquals("jutiiswacff", model.searchId()); + Assertions.assertEquals("k", model.resultType()); + Assertions.assertEquals(2817316502996814580L, model.total()); + Assertions.assertEquals(4896642944442173063L, model.top()); + Assertions.assertEquals("qcrailvpnppfufl", model.id()); + Assertions.assertEquals("hdlxyjrxsagafcn", model.coreSummaries().get(0).status()); + Assertions.assertEquals(3165727782283367859L, model.coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("vdrhvoo", model.status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-10T16:13:32Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-02T01:53:07Z"), model.lastUpdated()); + Assertions.assertEquals("bzdopcj", model.etag()); + Assertions.assertEquals("dldwmgxc", model.sort().get(0).name()); + Assertions.assertEquals(SearchSortEnum.DESC, model.sort().get(0).order()); + Assertions.assertEquals(9145208048517339786L, model.requestTime()); + Assertions.assertEquals("cpdggkzzlvmbmp", model.aggregatedValueField()); + Assertions.assertEquals("modfvuefywsbpfvm", model.aggregatedGroupingFields()); + Assertions.assertEquals(5583429102583863786L, model.sum()); + Assertions.assertEquals(98342047801553484L, model.max()); + Assertions.assertEquals("taakc", model.schema().name()); + Assertions.assertEquals(369562825, model.schema().version()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchMetadata model = new SearchMetadata().withSearchId("lwuip") - .withResultType("cjzkzivgvvcna") - .withTotal(8913535749004515550L) - .withTop(5279516661370439683L) - .withId("mueedndrdvstk") - .withCoreSummaries( - Arrays.asList(new CoreSummary().withStatus("chea").withNumberOfDocuments(3646125258806158004L))) - .withStatus("tdaaygdvwvg") - .withStartTime(OffsetDateTime.parse("2021-06-07T06:53:10Z")) - .withLastUpdated(OffsetDateTime.parse("2021-10-23T00:12:41Z")) - .withEtag("xrtfudxep") - .withSort(Arrays.asList(new SearchSort().withName("agvrvmnpkuk").withOrder(SearchSortEnum.ASC), - new SearchSort().withName("dblx").withOrder(SearchSortEnum.DESC))) - .withRequestTime(7611617377471579634L) - .withAggregatedValueField("hfjx") - .withAggregatedGroupingFields("szkkfoqre") - .withSum(8338807266312513089L) - .withMax(2185206310902116436L) - .withSchema(new SearchMetadataSchema().withName("wneaiv").withVersion(322973840)); + SearchMetadata model = new SearchMetadata().withSearchId("jutiiswacff") + .withResultType("k") + .withTotal(2817316502996814580L) + .withTop(4896642944442173063L) + .withId("qcrailvpnppfufl") + .withCoreSummaries(Arrays.asList( + new CoreSummary().withStatus("hdlxyjrxsagafcn").withNumberOfDocuments(3165727782283367859L), + new CoreSummary().withStatus("qapnedgfbcv").withNumberOfDocuments(3094759713825353725L), + new CoreSummary().withStatus("vpk").withNumberOfDocuments(1489368232618160329L))) + .withStatus("vdrhvoo") + .withStartTime(OffsetDateTime.parse("2021-11-10T16:13:32Z")) + .withLastUpdated(OffsetDateTime.parse("2021-11-02T01:53:07Z")) + .withEtag("bzdopcj") + .withSort(Arrays.asList(new SearchSort().withName("dldwmgxc").withOrder(SearchSortEnum.DESC), + new SearchSort().withName("pmutwuo").withOrder(SearchSortEnum.ASC), + new SearchSort().withName("khjwn").withOrder(SearchSortEnum.ASC))) + .withRequestTime(9145208048517339786L) + .withAggregatedValueField("cpdggkzzlvmbmp") + .withAggregatedGroupingFields("modfvuefywsbpfvm") + .withSum(5583429102583863786L) + .withMax(98342047801553484L) + .withSchema(new SearchMetadataSchema().withName("taakc").withVersion(369562825)); model = BinaryData.fromObject(model).toObject(SearchMetadata.class); - Assertions.assertEquals("lwuip", model.searchId()); - Assertions.assertEquals("cjzkzivgvvcna", model.resultType()); - Assertions.assertEquals(8913535749004515550L, model.total()); - Assertions.assertEquals(5279516661370439683L, model.top()); - Assertions.assertEquals("mueedndrdvstk", model.id()); - Assertions.assertEquals("chea", model.coreSummaries().get(0).status()); - Assertions.assertEquals(3646125258806158004L, model.coreSummaries().get(0).numberOfDocuments()); - Assertions.assertEquals("tdaaygdvwvg", model.status()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-07T06:53:10Z"), model.startTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-23T00:12:41Z"), model.lastUpdated()); - Assertions.assertEquals("xrtfudxep", model.etag()); - Assertions.assertEquals("agvrvmnpkuk", model.sort().get(0).name()); - Assertions.assertEquals(SearchSortEnum.ASC, model.sort().get(0).order()); - Assertions.assertEquals(7611617377471579634L, model.requestTime()); - Assertions.assertEquals("hfjx", model.aggregatedValueField()); - Assertions.assertEquals("szkkfoqre", model.aggregatedGroupingFields()); - Assertions.assertEquals(8338807266312513089L, model.sum()); - Assertions.assertEquals(2185206310902116436L, model.max()); - Assertions.assertEquals("wneaiv", model.schema().name()); - Assertions.assertEquals(322973840, model.schema().version()); + Assertions.assertEquals("jutiiswacff", model.searchId()); + Assertions.assertEquals("k", model.resultType()); + Assertions.assertEquals(2817316502996814580L, model.total()); + Assertions.assertEquals(4896642944442173063L, model.top()); + Assertions.assertEquals("qcrailvpnppfufl", model.id()); + Assertions.assertEquals("hdlxyjrxsagafcn", model.coreSummaries().get(0).status()); + Assertions.assertEquals(3165727782283367859L, model.coreSummaries().get(0).numberOfDocuments()); + Assertions.assertEquals("vdrhvoo", model.status()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-10T16:13:32Z"), model.startTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-02T01:53:07Z"), model.lastUpdated()); + Assertions.assertEquals("bzdopcj", model.etag()); + Assertions.assertEquals("dldwmgxc", model.sort().get(0).name()); + Assertions.assertEquals(SearchSortEnum.DESC, model.sort().get(0).order()); + Assertions.assertEquals(9145208048517339786L, model.requestTime()); + Assertions.assertEquals("cpdggkzzlvmbmp", model.aggregatedValueField()); + Assertions.assertEquals("modfvuefywsbpfvm", model.aggregatedGroupingFields()); + Assertions.assertEquals(5583429102583863786L, model.sum()); + Assertions.assertEquals(98342047801553484L, model.max()); + Assertions.assertEquals("taakc", model.schema().name()); + Assertions.assertEquals(369562825, model.schema().version()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java index ba8ec02b5961..1b6934cb5846 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchResultsTests.java @@ -13,27 +13,27 @@ public final class SearchResultsTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SearchResults model = BinaryData.fromString( - "{\"query\":\"fffwafqroudaspav\",\"description\":\"hrv\",\"limit\":901509130,\"startSearchTime\":\"2021-12-01T01:47:09Z\",\"endSearchTime\":\"2021-08-09T03:45:34Z\",\"sourceTable\":\"dhcxgkmoy\",\"azureAsyncOperationId\":\"dyuib\"}") + "{\"query\":\"olppvksrpqvujz\",\"description\":\"ehtwdwrft\",\"limit\":767551661,\"startSearchTime\":\"2021-10-26T11:25:15Z\",\"endSearchTime\":\"2021-11-04T23:57:55Z\",\"sourceTable\":\"l\",\"azureAsyncOperationId\":\"shfwpracstwity\"}") .toObject(SearchResults.class); - Assertions.assertEquals("fffwafqroudaspav", model.query()); - Assertions.assertEquals("hrv", model.description()); - Assertions.assertEquals(901509130, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T01:47:09Z"), model.startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T03:45:34Z"), model.endSearchTime()); + Assertions.assertEquals("olppvksrpqvujz", model.query()); + Assertions.assertEquals("ehtwdwrft", model.description()); + Assertions.assertEquals(767551661, model.limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T11:25:15Z"), model.startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T23:57:55Z"), model.endSearchTime()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchResults model = new SearchResults().withQuery("fffwafqroudaspav") - .withDescription("hrv") - .withLimit(901509130) - .withStartSearchTime(OffsetDateTime.parse("2021-12-01T01:47:09Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-08-09T03:45:34Z")); + SearchResults model = new SearchResults().withQuery("olppvksrpqvujz") + .withDescription("ehtwdwrft") + .withLimit(767551661) + .withStartSearchTime(OffsetDateTime.parse("2021-10-26T11:25:15Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-11-04T23:57:55Z")); model = BinaryData.fromObject(model).toObject(SearchResults.class); - Assertions.assertEquals("fffwafqroudaspav", model.query()); - Assertions.assertEquals("hrv", model.description()); - Assertions.assertEquals(901509130, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-01T01:47:09Z"), model.startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-08-09T03:45:34Z"), model.endSearchTime()); + Assertions.assertEquals("olppvksrpqvujz", model.query()); + Assertions.assertEquals("ehtwdwrft", model.description()); + Assertions.assertEquals(767551661, model.limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-10-26T11:25:15Z"), model.startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-04T23:57:55Z"), model.endSearchTime()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java index 1dde59a006c6..1f563325e92d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSchemaValueTests.java @@ -13,33 +13,33 @@ public final class SearchSchemaValueTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SearchSchemaValue model = BinaryData.fromString( - "{\"name\":\"ulpjr\",\"displayName\":\"ag\",\"type\":\"vimjwos\",\"indexed\":false,\"stored\":false,\"facet\":false,\"ownerType\":[\"skfc\",\"tq\",\"miekkezzikhlyfjh\",\"gqggebdunygae\"]}") + "{\"name\":\"xysmoc\",\"displayName\":\"qfqvmkc\",\"type\":\"zapvhelx\",\"indexed\":false,\"stored\":true,\"facet\":false,\"ownerType\":[\"tddckcb\",\"uejrjxgc\"]}") .toObject(SearchSchemaValue.class); - Assertions.assertEquals("ulpjr", model.name()); - Assertions.assertEquals("ag", model.displayName()); - Assertions.assertEquals("vimjwos", model.type()); - Assertions.assertEquals(false, model.indexed()); - Assertions.assertEquals(false, model.stored()); - Assertions.assertEquals(false, model.facet()); - Assertions.assertEquals("skfc", model.ownerType().get(0)); + Assertions.assertEquals("xysmoc", model.name()); + Assertions.assertEquals("qfqvmkc", model.displayName()); + Assertions.assertEquals("zapvhelx", model.type()); + Assertions.assertFalse(model.indexed()); + Assertions.assertTrue(model.stored()); + Assertions.assertFalse(model.facet()); + Assertions.assertEquals("tddckcb", model.ownerType().get(0)); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchSchemaValue model = new SearchSchemaValue().withName("ulpjr") - .withDisplayName("ag") - .withType("vimjwos") + SearchSchemaValue model = new SearchSchemaValue().withName("xysmoc") + .withDisplayName("qfqvmkc") + .withType("zapvhelx") .withIndexed(false) - .withStored(false) + .withStored(true) .withFacet(false) - .withOwnerType(Arrays.asList("skfc", "tq", "miekkezzikhlyfjh", "gqggebdunygae")); + .withOwnerType(Arrays.asList("tddckcb", "uejrjxgc")); model = BinaryData.fromObject(model).toObject(SearchSchemaValue.class); - Assertions.assertEquals("ulpjr", model.name()); - Assertions.assertEquals("ag", model.displayName()); - Assertions.assertEquals("vimjwos", model.type()); - Assertions.assertEquals(false, model.indexed()); - Assertions.assertEquals(false, model.stored()); - Assertions.assertEquals(false, model.facet()); - Assertions.assertEquals("skfc", model.ownerType().get(0)); + Assertions.assertEquals("xysmoc", model.name()); + Assertions.assertEquals("qfqvmkc", model.displayName()); + Assertions.assertEquals("zapvhelx", model.type()); + Assertions.assertFalse(model.indexed()); + Assertions.assertTrue(model.stored()); + Assertions.assertFalse(model.facet()); + Assertions.assertEquals("tddckcb", model.ownerType().get(0)); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java index 2cdc6d74a93c..9952fac215ff 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SearchSortTests.java @@ -12,16 +12,16 @@ public final class SearchSortTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - SearchSort model = BinaryData.fromString("{\"name\":\"kl\",\"order\":\"desc\"}").toObject(SearchSort.class); - Assertions.assertEquals("kl", model.name()); + SearchSort model = BinaryData.fromString("{\"name\":\"ondjmq\",\"order\":\"desc\"}").toObject(SearchSort.class); + Assertions.assertEquals("ondjmq", model.name()); Assertions.assertEquals(SearchSortEnum.DESC, model.order()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SearchSort model = new SearchSort().withName("kl").withOrder(SearchSortEnum.DESC); + SearchSort model = new SearchSort().withName("ondjmq").withOrder(SearchSortEnum.DESC); model = BinaryData.fromObject(model).toObject(SearchSort.class); - Assertions.assertEquals("kl", model.name()); + Assertions.assertEquals("ondjmq", model.name()); Assertions.assertEquals(SearchSortEnum.DESC, model.order()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java index 655116fd9ba7..f483957f3e4b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightConfigsDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,10 +25,10 @@ public void testDeleteWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); manager.storageInsightConfigs() - .deleteWithResponse("jjvpilguooqja", "m", "itgueiookjbs", com.azure.core.util.Context.NONE); + .deleteWithResponse("ewijymrhbguz", "zkye", "nfnzhhh", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java index 6912c6597be4..ac95b3a92c3a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/StorageInsightStatusTests.java @@ -12,17 +12,18 @@ public final class StorageInsightStatusTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - StorageInsightStatus model - = BinaryData.fromString("{\"state\":\"OK\",\"description\":\"n\"}").toObject(StorageInsightStatus.class); + StorageInsightStatus model = BinaryData.fromString("{\"state\":\"OK\",\"description\":\"kcdyhbpk\"}") + .toObject(StorageInsightStatus.class); Assertions.assertEquals(StorageInsightState.OK, model.state()); - Assertions.assertEquals("n", model.description()); + Assertions.assertEquals("kcdyhbpk", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - StorageInsightStatus model = new StorageInsightStatus().withState(StorageInsightState.OK).withDescription("n"); + StorageInsightStatus model + = new StorageInsightStatus().withState(StorageInsightState.OK).withDescription("kcdyhbpk"); model = BinaryData.fromObject(model).toObject(StorageInsightStatus.class); Assertions.assertEquals(StorageInsightState.OK, model.state()); - Assertions.assertEquals("n", model.description()); + Assertions.assertEquals("kcdyhbpk", model.description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationsStopWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationsStopWithResponseMockTests.java new file mode 100644 index 000000000000..bf0e2efcb40a --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsOperationsStopWithResponseMockTests.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.loganalytics.LogAnalyticsManager; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SummaryLogsOperationsStopWithResponseMockTests { + @Test + public void testStopWithResponse() throws Exception { + String responseStr = "{}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + LogAnalyticsManager manager = LogAnalyticsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + manager.summaryLogsOperations() + .stopWithResponse("t", "inklogxs", "tzarhzvqnsqktc", com.azure.core.util.Context.NONE); + + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinPropertiesTests.java new file mode 100644 index 000000000000..54f0d4458f74 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinPropertiesTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBinProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SummaryLogsRetryBinPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SummaryLogsRetryBinProperties model = BinaryData.fromString("{\"retryBinStartTime\":\"2021-07-20T22:39:45Z\"}") + .toObject(SummaryLogsRetryBinProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T22:39:45Z"), model.retryBinStartTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SummaryLogsRetryBinProperties model + = new SummaryLogsRetryBinProperties().withRetryBinStartTime(OffsetDateTime.parse("2021-07-20T22:39:45Z")); + model = BinaryData.fromObject(model).toObject(SummaryLogsRetryBinProperties.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-20T22:39:45Z"), model.retryBinStartTime()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinTests.java new file mode 100644 index 000000000000..060185115b7b --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SummaryLogsRetryBinTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBin; +import com.azure.resourcemanager.loganalytics.models.SummaryLogsRetryBinProperties; +import java.time.OffsetDateTime; +import org.junit.jupiter.api.Assertions; + +public final class SummaryLogsRetryBinTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SummaryLogsRetryBin model + = BinaryData.fromString("{\"properties\":{\"retryBinStartTime\":\"2021-09-02T16:11:18Z\"}}") + .toObject(SummaryLogsRetryBin.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T16:11:18Z"), model.properties().retryBinStartTime()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SummaryLogsRetryBin model = new SummaryLogsRetryBin().withProperties( + new SummaryLogsRetryBinProperties().withRetryBinStartTime(OffsetDateTime.parse("2021-09-02T16:11:18Z"))); + model = BinaryData.fromObject(model).toObject(SummaryLogsRetryBin.class); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-02T16:11:18Z"), model.properties().retryBinStartTime()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SystemDataAutoGeneratedTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SystemDataAutoGeneratedTests.java deleted file mode 100644 index 69d013603667..000000000000 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/SystemDataAutoGeneratedTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.loganalytics.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CreatedByType; -import com.azure.resourcemanager.loganalytics.models.SystemDataAutoGenerated; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; - -public final class SystemDataAutoGeneratedTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SystemDataAutoGenerated model = BinaryData.fromString( - "{\"createdBy\":\"dntwjchrdgo\",\"createdByType\":\"User\",\"createdAt\":\"2021-10-03T14:03:48Z\",\"lastModifiedBy\":\"ctondz\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-02-01T20:04:58Z\"}") - .toObject(SystemDataAutoGenerated.class); - Assertions.assertEquals("dntwjchrdgo", model.createdBy()); - Assertions.assertEquals(CreatedByType.USER, model.createdByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T14:03:48Z"), model.createdAt()); - Assertions.assertEquals("ctondz", model.lastModifiedBy()); - Assertions.assertEquals(CreatedByType.USER, model.lastModifiedByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T20:04:58Z"), model.lastModifiedAt()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SystemDataAutoGenerated model = new SystemDataAutoGenerated().withCreatedBy("dntwjchrdgo") - .withCreatedByType(CreatedByType.USER) - .withCreatedAt(OffsetDateTime.parse("2021-10-03T14:03:48Z")) - .withLastModifiedBy("ctondz") - .withLastModifiedByType(CreatedByType.USER) - .withLastModifiedAt(OffsetDateTime.parse("2021-02-01T20:04:58Z")); - model = BinaryData.fromObject(model).toObject(SystemDataAutoGenerated.class); - Assertions.assertEquals("dntwjchrdgo", model.createdBy()); - Assertions.assertEquals(CreatedByType.USER, model.createdByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-03T14:03:48Z"), model.createdAt()); - Assertions.assertEquals("ctondz", model.lastModifiedBy()); - Assertions.assertEquals(CreatedByType.USER, model.lastModifiedByType()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-01T20:04:58Z"), model.lastModifiedAt()); - } -} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java index cdca0715099d..c04c0f4b0c73 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TableInnerTests.java @@ -21,75 +21,85 @@ public final class TableInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableInner model = BinaryData.fromString( - "{\"properties\":{\"retentionInDays\":744996388,\"totalRetentionInDays\":1739983778,\"archiveRetentionInDays\":1797695866,\"searchResults\":{\"query\":\"vjlfrqtt\",\"description\":\"jlkatnwxy\",\"limit\":2086170636,\"startSearchTime\":\"2021-07-06T16:40:26Z\",\"endSearchTime\":\"2021-05-28T18:08:40Z\",\"sourceTable\":\"fku\",\"azureAsyncOperationId\":\"cxkdmligovi\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-07-15T21:34:15Z\",\"endRestoreTime\":\"2021-12-03T21:08:29Z\",\"sourceTable\":\"oaz\",\"azureAsyncOperationId\":\"u\"},\"resultStatistics\":{\"progress\":46.173687,\"ingestedRecords\":1776042141,\"scannedGb\":38.299255},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"ybfhjxa\",\"schema\":{\"name\":\"jgslordilmyww\",\"displayName\":\"gkxnyedabg\",\"description\":\"udtjuewbc\",\"columns\":[{\"name\":\"uwhcjyxccybv\",\"type\":\"int\",\"dataTypeHint\":\"guid\",\"displayName\":\"udzpxgwjplmagstc\",\"description\":\"hpfkyrkdbdgi\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"nwqjnoba\",\"type\":\"int\",\"dataTypeHint\":\"uri\",\"displayName\":\"iacegfnmn\",\"description\":\"pmvmemfnczdwvv\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"standardColumns\":[{\"name\":\"hpodbzev\",\"type\":\"long\",\"dataTypeHint\":\"uri\",\"displayName\":\"ukuv\",\"description\":\"cswsmystul\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"vlerchpqbmfpjba\",\"type\":\"dynamic\",\"dataTypeHint\":\"ip\",\"displayName\":\"xsspuunnoxyhk\",\"description\":\"qddrihpfhoqcaae\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"jvlpjxxkzbr\",\"type\":\"guid\",\"dataTypeHint\":\"guid\",\"displayName\":\"siykzkdncjdxonbz\",\"description\":\"gculap\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"ogtqxepnylbf\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"tlvofq\",\"description\":\"vfcibyfmowux\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"xfzwi\"],\"labels\":[\"zjb\",\"yzsxjrkambtrne\"],\"source\":\"microsoft\",\"tableType\":\"SearchResults\",\"tableSubType\":\"Classic\",\"solutions\":[\"vldspa\",\"tjb\",\"kdmflvestmjlx\",\"ril\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"pxlktwkuziycsl\",\"createdByType\":\"Key\",\"createdAt\":\"2021-08-14T04:43:23Z\",\"lastModifiedBy\":\"tcktyhjtqedcgzu\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-03-09T05:15:02Z\"},\"id\":\"qzz\",\"name\":\"rjvpglydzgkrvqee\",\"type\":\"toepryu\"}") + "{\"properties\":{\"retentionInDays\":1450729079,\"totalRetentionInDays\":981222471,\"archiveRetentionInDays\":5055042,\"searchResults\":{\"query\":\"hhyxxrw\",\"description\":\"co\",\"limit\":381030924,\"startSearchTime\":\"2021-05-28T17:22:29Z\",\"endSearchTime\":\"2021-03-31T06:04:43Z\",\"sourceTable\":\"ymareqnajxqugj\",\"azureAsyncOperationId\":\"ycubeddgs\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-06-13T04:37:53Z\",\"endRestoreTime\":\"2021-04-05T12:57Z\",\"sourceTable\":\"qal\",\"azureAsyncOperationId\":\"mnjijpxacqqudf\"},\"resultStatistics\":{\"progress\":55.070568,\"ingestedRecords\":701185139,\"scannedGb\":23.900133},\"plan\":\"Auxiliary\",\"lastPlanModifiedDate\":\"vayffimrzrt\",\"schema\":{\"name\":\"ogs\",\"displayName\":\"nevfdnw\",\"description\":\"mewzsyyc\",\"columns\":[{\"name\":\"oibjudpfrxtrthz\",\"type\":\"int\",\"dataTypeHint\":\"guid\",\"displayName\":\"kqb\",\"description\":\"ubpaxhe\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"pdtii\",\"type\":\"guid\",\"dataTypeHint\":\"armPath\",\"displayName\":\"axoruzfgsquy\",\"description\":\"rxxle\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"jezwlwnw\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"y\",\"description\":\"patdooaojkniodko\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"jhemms\",\"type\":\"real\",\"dataTypeHint\":\"uri\",\"displayName\":\"odtji\",\"description\":\"wj\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"standardColumns\":[{\"name\":\"vefkdlfoakggk\",\"type\":\"dynamic\",\"dataTypeHint\":\"uri\",\"displayName\":\"wpu\",\"description\":\"qblylsyxkqj\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"tiagx\",\"type\":\"string\",\"dataTypeHint\":\"uri\",\"displayName\":\"mpsbzkfzbeyv\",\"description\":\"qi\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"jjxd\",\"type\":\"guid\",\"dataTypeHint\":\"ip\",\"displayName\":\"zclewyhmlw\",\"description\":\"ztzp\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"yfzqwhxxbu\",\"qa\",\"zfeqztppri\",\"lxorjaltolmncws\"],\"labels\":[\"wcsdbnwdcfhucq\",\"pfuvglsbjjca\",\"vxb\",\"t\"],\"source\":\"microsoft\",\"tableType\":\"SearchResults\",\"tableSubType\":\"Classic\",\"solutions\":[\"mr\",\"xqtvcofu\",\"f\"]},\"provisioningState\":\"Deleting\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"id\":\"dknnqvsazn\",\"name\":\"n\",\"type\":\"orudsgsa\"}") .toObject(TableInner.class); - Assertions.assertEquals(744996388, model.retentionInDays()); - Assertions.assertEquals(1739983778, model.totalRetentionInDays()); - Assertions.assertEquals("vjlfrqtt", model.searchResults().query()); - Assertions.assertEquals("jlkatnwxy", model.searchResults().description()); - Assertions.assertEquals(2086170636, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T16:40:26Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T18:08:40Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T21:34:15Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T21:08:29Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("oaz", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.plan()); - Assertions.assertEquals("jgslordilmyww", model.schema().name()); - Assertions.assertEquals("gkxnyedabg", model.schema().displayName()); - Assertions.assertEquals("udtjuewbc", model.schema().description()); - Assertions.assertEquals("uwhcjyxccybv", model.schema().columns().get(0).name()); + Assertions.assertEquals(1450729079, model.retentionInDays()); + Assertions.assertEquals(981222471, model.totalRetentionInDays()); + Assertions.assertEquals("hhyxxrw", model.searchResults().query()); + Assertions.assertEquals("co", model.searchResults().description()); + Assertions.assertEquals(381030924, model.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T17:22:29Z"), model.searchResults().startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T06:04:43Z"), model.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T04:37:53Z"), model.restoredLogs().startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T12:57Z"), model.restoredLogs().endRestoreTime()); + Assertions.assertEquals("qal", model.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.AUXILIARY, model.plan()); + Assertions.assertEquals("ogs", model.schema().name()); + Assertions.assertEquals("nevfdnw", model.schema().displayName()); + Assertions.assertEquals("mewzsyyc", model.schema().description()); + Assertions.assertEquals("oibjudpfrxtrthz", model.schema().columns().get(0).name()); Assertions.assertEquals(ColumnTypeEnum.INT, model.schema().columns().get(0).type()); Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("udzpxgwjplmagstc", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("hpfkyrkdbdgi", model.schema().columns().get(0).description()); + Assertions.assertEquals("kqb", model.schema().columns().get(0).displayName()); + Assertions.assertEquals("ubpaxhe", model.schema().columns().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TableInner model = new TableInner().withRetentionInDays(744996388) - .withTotalRetentionInDays(1739983778) - .withSearchResults(new SearchResults().withQuery("vjlfrqtt") - .withDescription("jlkatnwxy") - .withLimit(2086170636) - .withStartSearchTime(OffsetDateTime.parse("2021-07-06T16:40:26Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-05-28T18:08:40Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-07-15T21:34:15Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-12-03T21:08:29Z")) - .withSourceTable("oaz")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("jgslordilmyww") - .withDisplayName("gkxnyedabg") - .withDescription("udtjuewbc") + TableInner model = new TableInner().withRetentionInDays(1450729079) + .withTotalRetentionInDays(981222471) + .withSearchResults(new SearchResults().withQuery("hhyxxrw") + .withDescription("co") + .withLimit(381030924) + .withStartSearchTime(OffsetDateTime.parse("2021-05-28T17:22:29Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-03-31T06:04:43Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-06-13T04:37:53Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-04-05T12:57Z")) + .withSourceTable("qal")) + .withPlan(TablePlanEnum.AUXILIARY) + .withSchema(new Schema().withName("ogs") + .withDisplayName("nevfdnw") + .withDescription("mewzsyyc") .withColumns(Arrays.asList( - new Column().withName("uwhcjyxccybv") + new Column().withName("oibjudpfrxtrthz") .withType(ColumnTypeEnum.INT) .withDataTypeHint(ColumnDataTypeHintEnum.GUID) - .withDisplayName("udzpxgwjplmagstc") - .withDescription("hpfkyrkdbdgi"), - new Column().withName("nwqjnoba") - .withType(ColumnTypeEnum.INT) + .withDisplayName("kqb") + .withDescription("ubpaxhe"), + new Column().withName("pdtii") + .withType(ColumnTypeEnum.GUID) + .withDataTypeHint(ColumnDataTypeHintEnum.ARM_PATH) + .withDisplayName("axoruzfgsquy") + .withDescription("rxxle"), + new Column().withName("jezwlwnw") + .withType(ColumnTypeEnum.REAL) + .withDataTypeHint(ColumnDataTypeHintEnum.ARM_PATH) + .withDisplayName("y") + .withDescription("patdooaojkniodko"), + new Column().withName("jhemms") + .withType(ColumnTypeEnum.REAL) .withDataTypeHint(ColumnDataTypeHintEnum.URI) - .withDisplayName("iacegfnmn") - .withDescription("pmvmemfnczdwvv")))); + .withDisplayName("odtji") + .withDescription("wj")))); model = BinaryData.fromObject(model).toObject(TableInner.class); - Assertions.assertEquals(744996388, model.retentionInDays()); - Assertions.assertEquals(1739983778, model.totalRetentionInDays()); - Assertions.assertEquals("vjlfrqtt", model.searchResults().query()); - Assertions.assertEquals("jlkatnwxy", model.searchResults().description()); - Assertions.assertEquals(2086170636, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-06T16:40:26Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T18:08:40Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-15T21:34:15Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-12-03T21:08:29Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("oaz", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.plan()); - Assertions.assertEquals("jgslordilmyww", model.schema().name()); - Assertions.assertEquals("gkxnyedabg", model.schema().displayName()); - Assertions.assertEquals("udtjuewbc", model.schema().description()); - Assertions.assertEquals("uwhcjyxccybv", model.schema().columns().get(0).name()); + Assertions.assertEquals(1450729079, model.retentionInDays()); + Assertions.assertEquals(981222471, model.totalRetentionInDays()); + Assertions.assertEquals("hhyxxrw", model.searchResults().query()); + Assertions.assertEquals("co", model.searchResults().description()); + Assertions.assertEquals(381030924, model.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-28T17:22:29Z"), model.searchResults().startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-31T06:04:43Z"), model.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T04:37:53Z"), model.restoredLogs().startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-04-05T12:57Z"), model.restoredLogs().endRestoreTime()); + Assertions.assertEquals("qal", model.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.AUXILIARY, model.plan()); + Assertions.assertEquals("ogs", model.schema().name()); + Assertions.assertEquals("nevfdnw", model.schema().displayName()); + Assertions.assertEquals("mewzsyyc", model.schema().description()); + Assertions.assertEquals("oibjudpfrxtrthz", model.schema().columns().get(0).name()); Assertions.assertEquals(ColumnTypeEnum.INT, model.schema().columns().get(0).type()); Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("udzpxgwjplmagstc", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("hpfkyrkdbdgi", model.schema().columns().get(0).description()); + Assertions.assertEquals("kqb", model.schema().columns().get(0).displayName()); + Assertions.assertEquals("ubpaxhe", model.schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java index 3ed057b6cffe..909b4652dfee 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablePropertiesTests.java @@ -21,69 +21,85 @@ public final class TablePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TableProperties model = BinaryData.fromString( - "{\"retentionInDays\":479918870,\"totalRetentionInDays\":2045022432,\"archiveRetentionInDays\":1783841206,\"searchResults\":{\"query\":\"o\",\"description\":\"vf\",\"limit\":1925116648,\"startSearchTime\":\"2021-10-04T03:30Z\",\"endSearchTime\":\"2021-11-05T03:00:16Z\",\"sourceTable\":\"f\",\"azureAsyncOperationId\":\"z\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-04-24T01:32:22Z\",\"endRestoreTime\":\"2021-11-03T23:30:17Z\",\"sourceTable\":\"cx\",\"azureAsyncOperationId\":\"t\"},\"resultStatistics\":{\"progress\":39.374405,\"ingestedRecords\":675680646,\"scannedGb\":64.79667},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"mldgxobfirc\",\"schema\":{\"name\":\"kciayzri\",\"displayName\":\"hya\",\"description\":\"vjlboxqvk\",\"columns\":[{\"name\":\"ho\",\"type\":\"boolean\",\"dataTypeHint\":\"guid\",\"displayName\":\"wdigumbnraauz\",\"description\":\"tj\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"zwwva\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"fonkphhqyikvyla\",\"description\":\"avluwmncs\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"bvpoekrsgsgbdhu\",\"type\":\"dynamic\",\"dataTypeHint\":\"uri\",\"displayName\":\"gkynscliqh\",\"description\":\"h\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"kubotppnvdxz\",\"type\":\"dateTime\",\"dataTypeHint\":\"guid\",\"displayName\":\"bbc\",\"description\":\"qagt\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"categories\":[\"qojpy\"],\"labels\":[\"trdcnifmzzs\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Any\",\"solutions\":[\"xmprafwg\"]},\"provisioningState\":\"Deleting\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false}") + "{\"retentionInDays\":220532000,\"totalRetentionInDays\":103703544,\"archiveRetentionInDays\":830439521,\"searchResults\":{\"query\":\"wjue\",\"description\":\"eburu\",\"limit\":1850094254,\"startSearchTime\":\"2021-01-16T01:35:10Z\",\"endSearchTime\":\"2021-09-18T15:34:48Z\",\"sourceTable\":\"l\",\"azureAsyncOperationId\":\"ab\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-09-17T06:29:30Z\",\"endRestoreTime\":\"2021-03-04T19:19:07Z\",\"sourceTable\":\"frvtpuqu\",\"azureAsyncOperationId\":\"qlgkfbtn\"},\"resultStatistics\":{\"progress\":47.37398,\"ingestedRecords\":1440714343,\"scannedGb\":33.60299},\"plan\":\"Auxiliary\",\"lastPlanModifiedDate\":\"ujitcjedftww\",\"schema\":{\"name\":\"kojvd\",\"displayName\":\"zfoqouicybxar\",\"description\":\"szufoxciqopidoa\",\"columns\":[{\"name\":\"dhkha\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"bon\",\"description\":\"ntoe\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"whkszzcmrvexztvb\",\"type\":\"dateTime\",\"dataTypeHint\":\"uri\",\"displayName\":\"aoyzkoow\",\"description\":\"mnguxawqaldsyu\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"qfobwyz\",\"type\":\"long\",\"dataTypeHint\":\"guid\",\"displayName\":\"t\",\"description\":\"fhpagmhrskdsnf\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"gtdlmk\",\"type\":\"long\",\"dataTypeHint\":\"guid\",\"displayName\":\"hewpusdsttwv\",\"description\":\"vbbejdcng\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"gm\",\"type\":\"int\",\"dataTypeHint\":\"guid\",\"displayName\":\"grtwae\",\"description\":\"uzkopbminrfd\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"ziuiefozbhdm\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"hoftr\",\"description\":\"equi\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"lfaoqzpiyylhaln\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"ph\",\"description\":\"ivwitqscywugg\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"bwemhairs\",\"rgzdwmsweyp\"],\"labels\":[\"xggicccnxqhuexmk\",\"tlstvlzywem\",\"zrncsdt\",\"lusiy\"],\"source\":\"customer\",\"tableType\":\"RestoredLogs\",\"tableSubType\":\"Classic\",\"solutions\":[\"sl\",\"eadcygqukyhejhz\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":true}") .toObject(TableProperties.class); - Assertions.assertEquals(479918870, model.retentionInDays()); - Assertions.assertEquals(2045022432, model.totalRetentionInDays()); - Assertions.assertEquals("o", model.searchResults().query()); - Assertions.assertEquals("vf", model.searchResults().description()); - Assertions.assertEquals(1925116648, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T03:30Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T03:00:16Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T01:32:22Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T23:30:17Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("cx", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.BASIC, model.plan()); - Assertions.assertEquals("kciayzri", model.schema().name()); - Assertions.assertEquals("hya", model.schema().displayName()); - Assertions.assertEquals("vjlboxqvk", model.schema().description()); - Assertions.assertEquals("ho", model.schema().columns().get(0).name()); + Assertions.assertEquals(220532000, model.retentionInDays()); + Assertions.assertEquals(103703544, model.totalRetentionInDays()); + Assertions.assertEquals("wjue", model.searchResults().query()); + Assertions.assertEquals("eburu", model.searchResults().description()); + Assertions.assertEquals(1850094254, model.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T01:35:10Z"), model.searchResults().startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T15:34:48Z"), model.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T06:29:30Z"), model.restoredLogs().startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T19:19:07Z"), model.restoredLogs().endRestoreTime()); + Assertions.assertEquals("frvtpuqu", model.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.AUXILIARY, model.plan()); + Assertions.assertEquals("kojvd", model.schema().name()); + Assertions.assertEquals("zfoqouicybxar", model.schema().displayName()); + Assertions.assertEquals("szufoxciqopidoa", model.schema().description()); + Assertions.assertEquals("dhkha", model.schema().columns().get(0).name()); Assertions.assertEquals(ColumnTypeEnum.BOOLEAN, model.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("wdigumbnraauz", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("tj", model.schema().columns().get(0).description()); + Assertions.assertEquals(ColumnDataTypeHintEnum.URI, model.schema().columns().get(0).dataTypeHint()); + Assertions.assertEquals("bon", model.schema().columns().get(0).displayName()); + Assertions.assertEquals("ntoe", model.schema().columns().get(0).description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TableProperties model = new TableProperties().withRetentionInDays(479918870) - .withTotalRetentionInDays(2045022432) - .withSearchResults(new SearchResults().withQuery("o") - .withDescription("vf") - .withLimit(1925116648) - .withStartSearchTime(OffsetDateTime.parse("2021-10-04T03:30Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-11-05T03:00:16Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-04-24T01:32:22Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-11-03T23:30:17Z")) - .withSourceTable("cx")) - .withPlan(TablePlanEnum.BASIC) - .withSchema(new Schema().withName("kciayzri") - .withDisplayName("hya") - .withDescription("vjlboxqvk") - .withColumns(Arrays.asList(new Column().withName("ho") - .withType(ColumnTypeEnum.BOOLEAN) - .withDataTypeHint(ColumnDataTypeHintEnum.GUID) - .withDisplayName("wdigumbnraauz") - .withDescription("tj")))); + TableProperties model = new TableProperties().withRetentionInDays(220532000) + .withTotalRetentionInDays(103703544) + .withSearchResults(new SearchResults().withQuery("wjue") + .withDescription("eburu") + .withLimit(1850094254) + .withStartSearchTime(OffsetDateTime.parse("2021-01-16T01:35:10Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-09-18T15:34:48Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-09-17T06:29:30Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-03-04T19:19:07Z")) + .withSourceTable("frvtpuqu")) + .withPlan(TablePlanEnum.AUXILIARY) + .withSchema(new Schema().withName("kojvd") + .withDisplayName("zfoqouicybxar") + .withDescription("szufoxciqopidoa") + .withColumns(Arrays.asList( + new Column().withName("dhkha") + .withType(ColumnTypeEnum.BOOLEAN) + .withDataTypeHint(ColumnDataTypeHintEnum.URI) + .withDisplayName("bon") + .withDescription("ntoe"), + new Column().withName("whkszzcmrvexztvb") + .withType(ColumnTypeEnum.DATE_TIME) + .withDataTypeHint(ColumnDataTypeHintEnum.URI) + .withDisplayName("aoyzkoow") + .withDescription("mnguxawqaldsyu"), + new Column().withName("qfobwyz") + .withType(ColumnTypeEnum.LONG) + .withDataTypeHint(ColumnDataTypeHintEnum.GUID) + .withDisplayName("t") + .withDescription("fhpagmhrskdsnf"), + new Column().withName("gtdlmk") + .withType(ColumnTypeEnum.LONG) + .withDataTypeHint(ColumnDataTypeHintEnum.GUID) + .withDisplayName("hewpusdsttwv") + .withDescription("vbbejdcng")))); model = BinaryData.fromObject(model).toObject(TableProperties.class); - Assertions.assertEquals(479918870, model.retentionInDays()); - Assertions.assertEquals(2045022432, model.totalRetentionInDays()); - Assertions.assertEquals("o", model.searchResults().query()); - Assertions.assertEquals("vf", model.searchResults().description()); - Assertions.assertEquals(1925116648, model.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-10-04T03:30Z"), model.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T03:00:16Z"), model.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-24T01:32:22Z"), model.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-03T23:30:17Z"), model.restoredLogs().endRestoreTime()); - Assertions.assertEquals("cx", model.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.BASIC, model.plan()); - Assertions.assertEquals("kciayzri", model.schema().name()); - Assertions.assertEquals("hya", model.schema().displayName()); - Assertions.assertEquals("vjlboxqvk", model.schema().description()); - Assertions.assertEquals("ho", model.schema().columns().get(0).name()); + Assertions.assertEquals(220532000, model.retentionInDays()); + Assertions.assertEquals(103703544, model.totalRetentionInDays()); + Assertions.assertEquals("wjue", model.searchResults().query()); + Assertions.assertEquals("eburu", model.searchResults().description()); + Assertions.assertEquals(1850094254, model.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-01-16T01:35:10Z"), model.searchResults().startSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-18T15:34:48Z"), model.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-17T06:29:30Z"), model.restoredLogs().startRestoreTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-04T19:19:07Z"), model.restoredLogs().endRestoreTime()); + Assertions.assertEquals("frvtpuqu", model.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.AUXILIARY, model.plan()); + Assertions.assertEquals("kojvd", model.schema().name()); + Assertions.assertEquals("zfoqouicybxar", model.schema().displayName()); + Assertions.assertEquals("szufoxciqopidoa", model.schema().description()); + Assertions.assertEquals("dhkha", model.schema().columns().get(0).name()); Assertions.assertEquals(ColumnTypeEnum.BOOLEAN, model.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.GUID, model.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("wdigumbnraauz", model.schema().columns().get(0).displayName()); - Assertions.assertEquals("tj", model.schema().columns().get(0).description()); + Assertions.assertEquals(ColumnDataTypeHintEnum.URI, model.schema().columns().get(0).dataTypeHint()); + Assertions.assertEquals("bon", model.schema().columns().get(0).displayName()); + Assertions.assertEquals("ntoe", model.schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java index 8fc39e4f9123..9e7a5de90ff5 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCancelSearchWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,10 @@ public void testCancelSearchWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.tables().cancelSearchWithResponse("myltj", "rspxklur", "clf", com.azure.core.util.Context.NONE); + manager.tables() + .cancelSearchWithResponse("bxsjybvitvqkj", "az", "umtggmuwdchozfn", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java index a5218a99664d..47b3fe36b9ae 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesCreateOrUpdateMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.Column; @@ -29,65 +29,75 @@ public final class TablesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"retentionInDays\":480341295,\"totalRetentionInDays\":27190578,\"archiveRetentionInDays\":1086111273,\"searchResults\":{\"query\":\"lidftujwjj\",\"description\":\"wbeqrkuor\",\"limit\":1870712650,\"startSearchTime\":\"2021-06-02T06:21:30Z\",\"endSearchTime\":\"2021-02-07T15:13:54Z\",\"sourceTable\":\"mdvhazcvjy\",\"azureAsyncOperationId\":\"qswbqerzwx\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-02-23T19:01:43Z\",\"endRestoreTime\":\"2021-05-09T17:49:27Z\",\"sourceTable\":\"ukvlb\",\"azureAsyncOperationId\":\"tgdstyouambe\"},\"resultStatistics\":{\"progress\":89.09465,\"ingestedRecords\":1285281809,\"scannedGb\":14.380062},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"mut\",\"schema\":{\"name\":\"eyguq\",\"displayName\":\"ijiitns\",\"description\":\"lz\",\"columns\":[{\"name\":\"grijwaiufanrayb\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"oj\",\"description\":\"dgrhydkygywezs\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"ygzmxieqvdsmak\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"hyhxa\",\"description\":\"bx\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"tblxpkkwjdjodqhy\",\"type\":\"int\",\"dataTypeHint\":\"uri\",\"displayName\":\"emehllizh\",\"description\":\"umoqodkad\",\"isDefaultDisplay\":true,\"isHidden\":true}],\"categories\":[\"qladywrxwhydtlu\",\"vadswzs\",\"uyem\",\"owuowh\"],\"labels\":[\"nwyrmouv\"],\"source\":\"customer\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"trfowtdvr\",\"mvlihcvjdrqcrjid\",\"ftukvhd\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"zd\",\"createdByType\":\"Application\",\"createdAt\":\"2021-03-22T04:05:19Z\",\"lastModifiedBy\":\"xhafratqx\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-11-30T03:06:43Z\"},\"id\":\"umzznvalqjrhuz\",\"name\":\"fxonjtpusllywp\",\"type\":\"tiotzb\"}"; + = "{\"properties\":{\"retentionInDays\":1532200707,\"totalRetentionInDays\":543172402,\"archiveRetentionInDays\":699290789,\"searchResults\":{\"query\":\"fccnuhiigb\",\"description\":\"bui\",\"limit\":1764547970,\"startSearchTime\":\"2021-06-14T14:08:19Z\",\"endSearchTime\":\"2021-05-03T08:54:55Z\",\"sourceTable\":\"rkdlb\",\"azureAsyncOperationId\":\"qxvhcsyhzlwxa\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-09-21T01:21:46Z\",\"endRestoreTime\":\"2021-05-18T07:30Z\",\"sourceTable\":\"xdndsbdweaderzm\",\"azureAsyncOperationId\":\"t\"},\"resultStatistics\":{\"progress\":86.6211,\"ingestedRecords\":1639161747,\"scannedGb\":6.1114073},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"goaqylkjztj\",\"schema\":{\"name\":\"zjcg\",\"displayName\":\"itpfinzcpdl\",\"description\":\"rlgjm\",\"columns\":[{\"name\":\"vcqguefzh\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"durelyujl\",\"description\":\"oumpcky\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"gptaj\",\"type\":\"boolean\",\"dataTypeHint\":\"armPath\",\"displayName\":\"ucycijo\",\"description\":\"xiutgjcyzyzj\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"txjeaoqaqbzgy\",\"type\":\"string\",\"dataTypeHint\":\"uri\",\"displayName\":\"atbwbqam\",\"description\":\"uliyslpkcv\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"pmywbormcq\",\"type\":\"guid\",\"dataTypeHint\":\"ip\",\"displayName\":\"qpkzfbojxjmcsmy\",\"description\":\"ixvcpwnkwywzwo\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"categories\":[\"uoiqt\",\"mt\"],\"labels\":[\"kn\",\"rwzawnvs\",\"cfhzagxnvhycv\",\"imwrzregzgyufu\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"kzkdhmeott\",\"w\",\"yos\",\"wwhnhjtfvpn\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"id\":\"wyn\",\"name\":\"dqllzsauzpjlxeeh\",\"type\":\"xiqhzlraymezxlsk\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Table response = manager.tables() - .define("oytzpose") - .withExistingWorkspace("xa", "n") - .withRetentionInDays(1606592668) - .withTotalRetentionInDays(1200171262) - .withSearchResults(new SearchResults().withQuery("aupxvpi") - .withDescription("f") - .withLimit(479705193) - .withStartSearchTime(OffsetDateTime.parse("2021-06-27T21:10:54Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-06-24T09:11:48Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-07-31T20:24:08Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-02-02T20:49:05Z")) - .withSourceTable("xwetwkdrcyrucpc")) - .withPlan(TablePlanEnum.BASIC) - .withSchema(new Schema().withName("dnelqkaad") - .withDisplayName("nwf") - .withDescription("nniyopetxi") + .define("akizvoaikna") + .withExistingWorkspace("fexl", "xn") + .withRetentionInDays(427869575) + .withTotalRetentionInDays(915740665) + .withSearchResults(new SearchResults().withQuery("lykwphvxz") + .withDescription("xhmpejtlkex") + .withLimit(780657181) + .withStartSearchTime(OffsetDateTime.parse("2021-09-17T09:38:18Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-08-12T17:38:45Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-03-10T18:49:30Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-10-06T09:15:33Z")) + .withSourceTable("kyupijubyqj")) + .withPlan(TablePlanEnum.ANALYTICS) + .withSchema(new Schema().withName("mgzvyfi") + .withDisplayName("kzuqnwsith") + .withDescription("olyahluqwqulsut") .withColumns(Arrays.asList( - new Column().withName("lyxnucaephb") - .withType(ColumnTypeEnum.GUID) - .withDataTypeHint(ColumnDataTypeHintEnum.URI) - .withDisplayName("tv") - .withDescription("sdtcjbctvivuzqym"), - new Column().withName("tgitsqhzvbrzc") - .withType(ColumnTypeEnum.DYNAMIC) + new Column().withName("xykfhyq") + .withType(ColumnTypeEnum.DATE_TIME) .withDataTypeHint(ColumnDataTypeHintEnum.IP) - .withDisplayName("ndscxmxeatk") - .withDescription("mwnrdj")))) + .withDisplayName("g") + .withDescription("ftbcvexreuquow"), + new Column().withName("hreagk") + .withType(ColumnTypeEnum.STRING) + .withDataTypeHint(ColumnDataTypeHintEnum.IP) + .withDisplayName("tvbczsulm") + .withDescription("glmep"), + new Column().withName("kgsangpszng") + .withType(ColumnTypeEnum.STRING) + .withDataTypeHint(ColumnDataTypeHintEnum.ARM_PATH) + .withDisplayName("kvec") + .withDescription("jcngoadyed"), + new Column().withName("oknub") + .withType(ColumnTypeEnum.DATE_TIME) + .withDataTypeHint(ColumnDataTypeHintEnum.GUID) + .withDisplayName("pz") + .withDescription("gdgxvcoqraswug")))) .create(); - Assertions.assertEquals(480341295, response.retentionInDays()); - Assertions.assertEquals(27190578, response.totalRetentionInDays()); - Assertions.assertEquals("lidftujwjj", response.searchResults().query()); - Assertions.assertEquals("wbeqrkuor", response.searchResults().description()); - Assertions.assertEquals(1870712650, response.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-02T06:21:30Z"), + Assertions.assertEquals(1532200707, response.retentionInDays()); + Assertions.assertEquals(543172402, response.totalRetentionInDays()); + Assertions.assertEquals("fccnuhiigb", response.searchResults().query()); + Assertions.assertEquals("bui", response.searchResults().description()); + Assertions.assertEquals(1764547970, response.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-06-14T14:08:19Z"), response.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-07T15:13:54Z"), response.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-23T19:01:43Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-05-03T08:54:55Z"), response.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2021-09-21T01:21:46Z"), response.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-05-09T17:49:27Z"), response.restoredLogs().endRestoreTime()); - Assertions.assertEquals("ukvlb", response.restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, response.plan()); - Assertions.assertEquals("eyguq", response.schema().name()); - Assertions.assertEquals("ijiitns", response.schema().displayName()); - Assertions.assertEquals("lz", response.schema().description()); - Assertions.assertEquals("grijwaiufanrayb", response.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.REAL, response.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.ARM_PATH, response.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("oj", response.schema().columns().get(0).displayName()); - Assertions.assertEquals("dgrhydkygywezs", response.schema().columns().get(0).description()); + Assertions.assertEquals(OffsetDateTime.parse("2021-05-18T07:30Z"), response.restoredLogs().endRestoreTime()); + Assertions.assertEquals("xdndsbdweaderzm", response.restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.BASIC, response.plan()); + Assertions.assertEquals("zjcg", response.schema().name()); + Assertions.assertEquals("itpfinzcpdl", response.schema().displayName()); + Assertions.assertEquals("rlgjm", response.schema().description()); + Assertions.assertEquals("vcqguefzh", response.schema().columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.STRING, response.schema().columns().get(0).type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.IP, response.schema().columns().get(0).dataTypeHint()); + Assertions.assertEquals("durelyujl", response.schema().columns().get(0).displayName()); + Assertions.assertEquals("oumpcky", response.schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java index 823a115012ca..eb4fe5983d9a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.tables().delete("rkgwltxeqip", "gzdyimsfayorp", "avkjog", com.azure.core.util.Context.NONE); + manager.tables().delete("rsofpltdbmairrh", "hfnrac", "npq", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java index ef1834667e11..87a879528665 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesGetWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; @@ -24,39 +24,39 @@ public final class TablesGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"retentionInDays\":1168808481,\"totalRetentionInDays\":248802373,\"archiveRetentionInDays\":564672857,\"searchResults\":{\"query\":\"buhzacaq\",\"description\":\"ltcoqc\",\"limit\":1004609054,\"startSearchTime\":\"2021-06-10T09:18:11Z\",\"endSearchTime\":\"2021-04-18T12:03:07Z\",\"sourceTable\":\"kuejk\",\"azureAsyncOperationId\":\"bizt\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-09-28T22:56:41Z\",\"endRestoreTime\":\"2021-06-13T10:08:38Z\",\"sourceTable\":\"vjufycsjmlbe\",\"azureAsyncOperationId\":\"ej\"},\"resultStatistics\":{\"progress\":97.11777,\"ingestedRecords\":859653726,\"scannedGb\":22.48292},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"tudaw\",\"schema\":{\"name\":\"felqerpptc\",\"displayName\":\"qnzmnhiil\",\"description\":\"lwcjgckbbcccgzpr\",\"columns\":[{\"name\":\"yuffatsgf\",\"type\":\"string\",\"dataTypeHint\":\"uri\",\"displayName\":\"byubhiqdxyurnpn\",\"description\":\"zafccnuhiigb\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"vxva\",\"type\":\"real\",\"dataTypeHint\":\"guid\",\"displayName\":\"lbnb\",\"description\":\"vhcs\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"aeaovur\",\"type\":\"dateTime\",\"dataTypeHint\":\"uri\",\"displayName\":\"bdweade\",\"description\":\"mwntopagttmvmma\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"kjztjiuazjcgmxi\",\"type\":\"string\",\"dataTypeHint\":\"armPath\",\"displayName\":\"cpdltkrlg\",\"description\":\"tbdrvcqgue\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"qdurelyujlfyoum\",\"type\":\"dateTime\",\"dataTypeHint\":\"ip\",\"displayName\":\"lcdi\",\"description\":\"tajbrz\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"ci\",\"type\":\"real\",\"dataTypeHint\":\"armPath\",\"displayName\":\"utgjcyz\",\"description\":\"jdnrqjbt\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"aqbzgyhfwwvuatbw\",\"type\":\"guid\",\"dataTypeHint\":\"guid\",\"displayName\":\"uliyslpkcv\",\"description\":\"f\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"myw\",\"type\":\"guid\",\"dataTypeHint\":\"uri\",\"displayName\":\"miciij\",\"description\":\"kzfbojxjmcsmyq\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"nkwywzwofa\",\"ickduoiqta\",\"t\"],\"labels\":[\"kn\",\"rwzawnvs\",\"cfhzagxnvhycv\",\"imwrzregzgyufu\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Classic\",\"solutions\":[\"kzkdhmeott\",\"w\",\"yos\",\"wwhnhjtfvpn\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"ynudqllzsa\",\"createdByType\":\"Key\",\"createdAt\":\"2021-01-28T04:04:17Z\",\"lastModifiedBy\":\"eehuxiqhzlray\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-06-28T07:28:45Z\"},\"id\":\"kihmxrfdsajredn\",\"name\":\"yyshtuwgmevua\",\"type\":\"pwzyi\"}"; + = "{\"properties\":{\"retentionInDays\":173129276,\"totalRetentionInDays\":1276247393,\"archiveRetentionInDays\":611963257,\"searchResults\":{\"query\":\"lblhtjq\",\"description\":\"yvwehtaemxh\",\"limit\":974813630,\"startSearchTime\":\"2021-07-22T16:02:08Z\",\"endSearchTime\":\"2021-06-03T23:18:21Z\",\"sourceTable\":\"xivzrrry\",\"azureAsyncOperationId\":\"imipskdyzatvfuz\"},\"restoredLogs\":{\"startRestoreTime\":\"2020-12-21T06:07:21Z\",\"endRestoreTime\":\"2021-03-13T04:29:21Z\",\"sourceTable\":\"ru\",\"azureAsyncOperationId\":\"igsyeipqdsmjt\"},\"resultStatistics\":{\"progress\":32.653797,\"ingestedRecords\":1529968527,\"scannedGb\":98.93236},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"plkcsm\",\"schema\":{\"name\":\"wtbbaedorvvmqf\",\"displayName\":\"ygbdgwumgxdgdhpa\",\"description\":\"dexjddvjs\",\"columns\":[{\"name\":\"tm\",\"type\":\"guid\",\"dataTypeHint\":\"ip\",\"displayName\":\"lsrs\",\"description\":\"pt\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"gjokjljnhvlqjbek\",\"type\":\"guid\",\"dataTypeHint\":\"armPath\",\"displayName\":\"bksdqhjvyklxesl\",\"description\":\"hustcpoqmavnwqjw\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"jjjkxybwfdbk\",\"type\":\"guid\",\"dataTypeHint\":\"armPath\",\"displayName\":\"svkzykj\",\"description\":\"kns\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"cdp\",\"type\":\"string\",\"dataTypeHint\":\"armPath\",\"displayName\":\"mgjfbpkuwxeoio\",\"description\":\"izfavkjzwf\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"fz\",\"type\":\"boolean\",\"dataTypeHint\":\"ip\",\"displayName\":\"zxmdew\",\"description\":\"sxkrpl\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"categories\":[\"w\",\"iyoypsuhbrnnhj\"],\"labels\":[\"wjh\",\"kbiwetpozyc\",\"qiqyhgfsetzlexbs\",\"ledynojpz\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Any\",\"solutions\":[\"tnhqsycl\"]},\"provisioningState\":\"Deleting\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":true},\"id\":\"afvafh\",\"name\":\"by\",\"type\":\"ccbevxrhyzdf\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Table response = manager.tables() - .getWithResponse("ubn", "itpkpztrgdg", "vcoqraswugyxpqi", com.azure.core.util.Context.NONE) + .getWithResponse("wqapfgsdp", "vessm", "hhkuuip", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals(1168808481, response.retentionInDays()); - Assertions.assertEquals(248802373, response.totalRetentionInDays()); - Assertions.assertEquals("buhzacaq", response.searchResults().query()); - Assertions.assertEquals("ltcoqc", response.searchResults().description()); - Assertions.assertEquals(1004609054, response.searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-10T09:18:11Z"), + Assertions.assertEquals(173129276, response.retentionInDays()); + Assertions.assertEquals(1276247393, response.totalRetentionInDays()); + Assertions.assertEquals("lblhtjq", response.searchResults().query()); + Assertions.assertEquals("yvwehtaemxh", response.searchResults().description()); + Assertions.assertEquals(974813630, response.searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-22T16:02:08Z"), response.searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-18T12:03:07Z"), response.searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-09-28T22:56:41Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-06-03T23:18:21Z"), response.searchResults().endSearchTime()); + Assertions.assertEquals(OffsetDateTime.parse("2020-12-21T06:07:21Z"), response.restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-06-13T10:08:38Z"), response.restoredLogs().endRestoreTime()); - Assertions.assertEquals("vjufycsjmlbe", response.restoredLogs().sourceTable()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T04:29:21Z"), response.restoredLogs().endRestoreTime()); + Assertions.assertEquals("ru", response.restoredLogs().sourceTable()); Assertions.assertEquals(TablePlanEnum.ANALYTICS, response.plan()); - Assertions.assertEquals("felqerpptc", response.schema().name()); - Assertions.assertEquals("qnzmnhiil", response.schema().displayName()); - Assertions.assertEquals("lwcjgckbbcccgzpr", response.schema().description()); - Assertions.assertEquals("yuffatsgf", response.schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.STRING, response.schema().columns().get(0).type()); - Assertions.assertEquals(ColumnDataTypeHintEnum.URI, response.schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("byubhiqdxyurnpn", response.schema().columns().get(0).displayName()); - Assertions.assertEquals("zafccnuhiigb", response.schema().columns().get(0).description()); + Assertions.assertEquals("wtbbaedorvvmqf", response.schema().name()); + Assertions.assertEquals("ygbdgwumgxdgdhpa", response.schema().displayName()); + Assertions.assertEquals("dexjddvjs", response.schema().description()); + Assertions.assertEquals("tm", response.schema().columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.GUID, response.schema().columns().get(0).type()); + Assertions.assertEquals(ColumnDataTypeHintEnum.IP, response.schema().columns().get(0).dataTypeHint()); + Assertions.assertEquals("lsrs", response.schema().columns().get(0).displayName()); + Assertions.assertEquals("pt", response.schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java index 412e46fd379a..da5b0231cd34 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListByWorkspaceMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.ColumnDataTypeHintEnum; @@ -25,41 +25,41 @@ public final class TablesListByWorkspaceMockTests { @Test public void testListByWorkspace() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"retentionInDays\":143517524,\"totalRetentionInDays\":1172309322,\"archiveRetentionInDays\":1559182660,\"searchResults\":{\"query\":\"mmfz\",\"description\":\"fwxrzxmdew\",\"limit\":1373177035,\"startSearchTime\":\"2021-04-20T22:50:05Z\",\"endSearchTime\":\"2021-01-08T17:25:29Z\",\"sourceTable\":\"bjazejwwviy\",\"azureAsyncOperationId\":\"ps\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-11-20T14:34:31Z\",\"endRestoreTime\":\"2021-01-22T13:49:23Z\",\"sourceTable\":\"jxsqwjhqkbiwetp\",\"azureAsyncOperationId\":\"ycyqiqyhgfsetzl\"},\"resultStatistics\":{\"progress\":37.550117,\"ingestedRecords\":207278850,\"scannedGb\":68.76575},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"jpziu\",\"schema\":{\"name\":\"zkkdtnhqs\",\"displayName\":\"ljselp\",\"description\":\"bafvafhlbylcc\",\"columns\":[{\"name\":\"rhyzdf\",\"type\":\"real\",\"dataTypeHint\":\"uri\",\"displayName\":\"ltdb\",\"description\":\"irrhv\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"standardColumns\":[{\"name\":\"pqigtuujwouhd\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"bjb\",\"description\":\"jybvit\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"znumtggmuwdchoz\",\"type\":\"long\",\"dataTypeHint\":\"armPath\",\"displayName\":\"lv\",\"description\":\"oakizvoai\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"uwiguyxlyk\",\"type\":\"boolean\",\"dataTypeHint\":\"armPath\",\"displayName\":\"cwxhmpej\",\"description\":\"ke\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"vkcqhr\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"ccrmmk\",\"description\":\"pijubyq\",\"isDefaultDisplay\":false,\"isHidden\":false}],\"categories\":[\"frkemyildudxja\",\"cowvfdjkp\",\"xphlkksnmg\",\"vyfijdkzuqnw\"],\"labels\":[\"huqol\",\"ah\",\"uqwqulsutrjbhxyk\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"Any\",\"solutions\":[\"ugdrftbc\",\"exreu\",\"uowtljvfwhrea\",\"khyxvrqtvbcz\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"epjpfs\",\"createdByType\":\"ManagedIdentity\",\"createdAt\":\"2021-11-01T10:59:42Z\",\"lastModifiedBy\":\"ngpszngafpg\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-07-27T16:28:59Z\"},\"id\":\"cj\",\"name\":\"jcngoadyed\",\"type\":\"zrgjfok\"}]}"; + = "{\"value\":[{\"properties\":{\"retentionInDays\":1986729733,\"totalRetentionInDays\":260996663,\"archiveRetentionInDays\":1750889059,\"searchResults\":{\"query\":\"cdxa\",\"description\":\"u\",\"limit\":2063766495,\"startSearchTime\":\"2021-08-26T08:46Z\",\"endSearchTime\":\"2021-09-09T20:53:20Z\",\"sourceTable\":\"bklqpxz\",\"azureAsyncOperationId\":\"afeddwwnlza\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-04-21T23:27:57Z\",\"endRestoreTime\":\"2021-11-21T23:37:33Z\",\"sourceTable\":\"hgookrtalvnbwgpb\",\"azureAsyncOperationId\":\"eluclvdjj\"},\"resultStatistics\":{\"progress\":84.43588,\"ingestedRecords\":574084923,\"scannedGb\":58.54812},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"hhxhq\",\"schema\":{\"name\":\"nvzoqgyipemch\",\"displayName\":\"v\",\"description\":\"zuejd\",\"columns\":[{\"name\":\"lghwzhome\",\"type\":\"string\",\"dataTypeHint\":\"uri\",\"displayName\":\"iuh\",\"description\":\"wmoaiancznvodrrs\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"kxrx\",\"type\":\"dateTime\",\"dataTypeHint\":\"armPath\",\"displayName\":\"kgfbqljnqkhy\",\"description\":\"ocokule\",\"isDefaultDisplay\":true,\"isHidden\":false},{\"name\":\"qffawey\",\"type\":\"boolean\",\"dataTypeHint\":\"uri\",\"displayName\":\"jdxravjuqdbrx\",\"description\":\"gchbapxkiy\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"jbuscg\",\"type\":\"string\",\"dataTypeHint\":\"guid\",\"displayName\":\"ycblevpmcl\",\"description\":\"yxkyxlz\",\"isDefaultDisplay\":false,\"isHidden\":true}],\"standardColumns\":[{\"name\":\"taf\",\"type\":\"boolean\",\"dataTypeHint\":\"ip\",\"displayName\":\"vwmbjlzqsczpg\",\"description\":\"wnapfdq\",\"isDefaultDisplay\":false,\"isHidden\":true},{\"name\":\"tnuwjtkschgc\",\"type\":\"string\",\"dataTypeHint\":\"ip\",\"displayName\":\"seyqrhvyeldotjv\",\"description\":\"wiswskukjtasbvw\",\"isDefaultDisplay\":true,\"isHidden\":true},{\"name\":\"dtxfkndlqvtwknvg\",\"type\":\"dateTime\",\"dataTypeHint\":\"ip\",\"displayName\":\"yw\",\"description\":\"mqaqkueatgroes\",\"isDefaultDisplay\":false,\"isHidden\":false},{\"name\":\"byfqxkfaoy\",\"type\":\"string\",\"dataTypeHint\":\"armPath\",\"displayName\":\"vjmvqmtdwckygr\",\"description\":\"jn\",\"isDefaultDisplay\":true,\"isHidden\":false}],\"categories\":[\"skbrreqynkc\",\"ysfaqegplwrysh\"],\"labels\":[\"kvb\"],\"source\":\"customer\",\"tableType\":\"RestoredLogs\",\"tableSubType\":\"Any\",\"solutions\":[\"ptdacarvvl\"]},\"provisioningState\":\"Deleting\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"id\":\"iwenazero\",\"name\":\"zrsq\",\"type\":\"lsxkd\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.tables().listByWorkspace("upnqrmgjfb", "kuwxeoiojfizfavk", com.azure.core.util.Context.NONE); + = manager.tables().listByWorkspace("kxrerlniylylyfwx", "utgqztwh", com.azure.core.util.Context.NONE); - Assertions.assertEquals(143517524, response.iterator().next().retentionInDays()); - Assertions.assertEquals(1172309322, response.iterator().next().totalRetentionInDays()); - Assertions.assertEquals("mmfz", response.iterator().next().searchResults().query()); - Assertions.assertEquals("fwxrzxmdew", response.iterator().next().searchResults().description()); - Assertions.assertEquals(1373177035, response.iterator().next().searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-20T22:50:05Z"), + Assertions.assertEquals(1986729733, response.iterator().next().retentionInDays()); + Assertions.assertEquals(260996663, response.iterator().next().totalRetentionInDays()); + Assertions.assertEquals("cdxa", response.iterator().next().searchResults().query()); + Assertions.assertEquals("u", response.iterator().next().searchResults().description()); + Assertions.assertEquals(2063766495, response.iterator().next().searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-26T08:46Z"), response.iterator().next().searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-08T17:25:29Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-09-09T20:53:20Z"), response.iterator().next().searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-20T14:34:31Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-21T23:27:57Z"), response.iterator().next().restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-22T13:49:23Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-11-21T23:37:33Z"), response.iterator().next().restoredLogs().endRestoreTime()); - Assertions.assertEquals("jxsqwjhqkbiwetp", response.iterator().next().restoredLogs().sourceTable()); + Assertions.assertEquals("hgookrtalvnbwgpb", response.iterator().next().restoredLogs().sourceTable()); Assertions.assertEquals(TablePlanEnum.BASIC, response.iterator().next().plan()); - Assertions.assertEquals("zkkdtnhqs", response.iterator().next().schema().name()); - Assertions.assertEquals("ljselp", response.iterator().next().schema().displayName()); - Assertions.assertEquals("bafvafhlbylcc", response.iterator().next().schema().description()); - Assertions.assertEquals("rhyzdf", response.iterator().next().schema().columns().get(0).name()); - Assertions.assertEquals(ColumnTypeEnum.REAL, response.iterator().next().schema().columns().get(0).type()); + Assertions.assertEquals("nvzoqgyipemch", response.iterator().next().schema().name()); + Assertions.assertEquals("v", response.iterator().next().schema().displayName()); + Assertions.assertEquals("zuejd", response.iterator().next().schema().description()); + Assertions.assertEquals("lghwzhome", response.iterator().next().schema().columns().get(0).name()); + Assertions.assertEquals(ColumnTypeEnum.STRING, response.iterator().next().schema().columns().get(0).type()); Assertions.assertEquals(ColumnDataTypeHintEnum.URI, response.iterator().next().schema().columns().get(0).dataTypeHint()); - Assertions.assertEquals("ltdb", response.iterator().next().schema().columns().get(0).displayName()); - Assertions.assertEquals("irrhv", response.iterator().next().schema().columns().get(0).description()); + Assertions.assertEquals("iuh", response.iterator().next().schema().columns().get(0).displayName()); + Assertions.assertEquals("wmoaiancznvodrrs", response.iterator().next().schema().columns().get(0).description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java index fd41a98a5f76..7c2eff2f4ce6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesListResultTests.java @@ -20,94 +20,79 @@ public final class TablesListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { TablesListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"retentionInDays\":1152356837,\"totalRetentionInDays\":230467636,\"archiveRetentionInDays\":1993035285,\"searchResults\":{\"query\":\"fmviklby\",\"description\":\"khbejdznxc\",\"limit\":2045200930,\"startSearchTime\":\"2021-03-13T18:49:59Z\",\"endSearchTime\":\"2020-12-24T21:57:15Z\",\"sourceTable\":\"volvtn\",\"azureAsyncOperationId\":\"qfzgemjdftul\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-11-05T22:04:39Z\",\"endRestoreTime\":\"2021-04-12T02:20:30Z\",\"sourceTable\":\"amtmcz\",\"azureAsyncOperationId\":\"m\"},\"resultStatistics\":{\"progress\":45.98984,\"ingestedRecords\":1157846345,\"scannedGb\":57.057808},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"ssxmojms\",\"schema\":{\"name\":\"jpr\",\"displayName\":\"wcfzqljyxgt\",\"description\":\"heyd\",\"columns\":[{},{},{},{}],\"standardColumns\":[{},{},{}],\"categories\":[\"xmaehvbbxu\"],\"labels\":[\"ltfnhtbaxkgx\",\"wrck\",\"yklyhpluodpvruud\"],\"source\":\"microsoft\",\"tableType\":\"Microsoft\",\"tableSubType\":\"Classic\",\"solutions\":[\"tgk\",\"stvdxeclz\"]},\"provisioningState\":\"Succeeded\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":true},\"systemData\":{\"createdBy\":\"h\",\"createdByType\":\"ManagedIdentity\",\"createdAt\":\"2021-07-07T17:09:43Z\",\"lastModifiedBy\":\"dlwwqfbumlkxt\",\"lastModifiedByType\":\"Key\",\"lastModifiedAt\":\"2021-08-10T18:01:13Z\"},\"id\":\"mlmbtxhwgfwsrta\",\"name\":\"coezbrhubskh\",\"type\":\"dyg\"},{\"properties\":{\"retentionInDays\":328293320,\"totalRetentionInDays\":1039197688,\"archiveRetentionInDays\":870237510,\"searchResults\":{\"query\":\"vleo\",\"description\":\"ml\",\"limit\":16475569,\"startSearchTime\":\"2021-06-03T05:33:27Z\",\"endSearchTime\":\"2021-06-07T14:08:39Z\",\"sourceTable\":\"vyvnqqyb\",\"azureAsyncOperationId\":\"yeua\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-05-25T11:37:10Z\",\"endRestoreTime\":\"2021-04-19T19:49:12Z\",\"sourceTable\":\"gzslesjcbhernnti\",\"azureAsyncOperationId\":\"djc\"},\"resultStatistics\":{\"progress\":67.018715,\"ingestedRecords\":584080581,\"scannedGb\":39.08969},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"gohbuffkmrq\",\"schema\":{\"name\":\"vhmxtdrjfu\",\"displayName\":\"coebjvewzcj\",\"description\":\"m\",\"columns\":[{},{},{},{}],\"standardColumns\":[{},{},{},{}],\"categories\":[\"adraufactkahzo\",\"ajjziuxxpshne\",\"kulfg\",\"lqubkwdlen\"],\"labels\":[\"utujba\",\"pjuohminyfl\"],\"source\":\"microsoft\",\"tableType\":\"CustomLog\",\"tableSubType\":\"DataCollectionRuleBased\",\"solutions\":[\"pklvxw\",\"ygdxpgpqchis\"]},\"provisioningState\":\"InProgress\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":true},\"systemData\":{\"createdBy\":\"xgibbda\",\"createdByType\":\"User\",\"createdAt\":\"2021-04-14T22:25:17Z\",\"lastModifiedBy\":\"zauorsuk\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-09-20T10:27:45Z\"},\"id\":\"plhlvnuuepzlrp\",\"name\":\"wzsoldweyuqdunv\",\"type\":\"nnrwrbiork\"},{\"properties\":{\"retentionInDays\":476504183,\"totalRetentionInDays\":681185824,\"archiveRetentionInDays\":1038080670,\"searchResults\":{\"query\":\"nhxmsi\",\"description\":\"omi\",\"limit\":1723847557,\"startSearchTime\":\"2021-10-29T08:24:04Z\",\"endSearchTime\":\"2021-01-25T20:05:05Z\",\"sourceTable\":\"iqndieuzaofj\",\"azureAsyncOperationId\":\"vcyy\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-05-03T11:29:59Z\",\"endRestoreTime\":\"2021-05-09T21:38:39Z\",\"sourceTable\":\"cubiipuipw\",\"azureAsyncOperationId\":\"onmacjekniz\"},\"resultStatistics\":{\"progress\":38.670307,\"ingestedRecords\":1591499316,\"scannedGb\":21.702797},\"plan\":\"Analytics\",\"lastPlanModifiedDate\":\"gmblrri\",\"schema\":{\"name\":\"wdxsm\",\"displayName\":\"cwrwfs\",\"description\":\"fnynszqujizdvoqy\",\"columns\":[{},{},{},{}],\"standardColumns\":[{}],\"categories\":[\"blgyavutpthj\",\"xoi\",\"msksbp\"],\"labels\":[\"qolj\"],\"source\":\"microsoft\",\"tableType\":\"SearchResults\",\"tableSubType\":\"Classic\",\"solutions\":[\"ffgcvizqz\",\"wlvwlyoupf\",\"fbkjubdyhgkfmi\"]},\"provisioningState\":\"Updating\",\"retentionInDaysAsDefault\":false,\"totalRetentionInDaysAsDefault\":false},\"systemData\":{\"createdBy\":\"sttktlahbqa\",\"createdByType\":\"Key\",\"createdAt\":\"2021-10-13T12:53:05Z\",\"lastModifiedBy\":\"ukxit\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-06-28T23:57:13Z\"},\"id\":\"qqqxhrnxrx\",\"name\":\"pjui\",\"type\":\"av\"}]}") + "{\"value\":[{\"properties\":{\"retentionInDays\":288092317,\"totalRetentionInDays\":1703781779,\"archiveRetentionInDays\":995419481,\"searchResults\":{\"query\":\"bwwift\",\"description\":\"qkvpuvksgplsakn\",\"limit\":792282663,\"startSearchTime\":\"2021-08-07T07:41:08Z\",\"endSearchTime\":\"2021-04-07T05:17:19Z\",\"sourceTable\":\"ph\",\"azureAsyncOperationId\":\"pxodlqiyntorzih\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-07-03T10:26:48Z\",\"endRestoreTime\":\"2021-08-13T08:44:45Z\",\"sourceTable\":\"srmslyzr\",\"azureAsyncOperationId\":\"bchckqqzqio\"},\"resultStatistics\":{\"progress\":77.20928,\"ingestedRecords\":1721034864,\"scannedGb\":44.14792},\"plan\":\"Basic\",\"lastPlanModifiedDate\":\"edyatrwyhqmibzyh\",\"schema\":{\"name\":\"smypyynpc\",\"displayName\":\"umnzgmwznmabik\",\"description\":\"orgjhxbldt\",\"columns\":[{},{}],\"standardColumns\":[{},{},{},{}],\"categories\":[\"m\",\"ncvokotllxdyhg\"],\"labels\":[\"cogjltdtbn\",\"hadoocrk\"],\"source\":\"customer\",\"tableType\":\"RestoredLogs\",\"tableSubType\":\"DataCollectionRuleBased\",\"solutions\":[\"mqg\",\"qqu\",\"zikywgg\",\"kallatmel\"]},\"provisioningState\":\"InProgress\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":true},\"id\":\"zkzivgvvcnay\",\"name\":\"hyrnxxmu\",\"type\":\"edndr\"},{\"properties\":{\"retentionInDays\":817024636,\"totalRetentionInDays\":467483193,\"archiveRetentionInDays\":768624981,\"searchResults\":{\"query\":\"healmfmtda\",\"description\":\"gdv\",\"limit\":1689077175,\"startSearchTime\":\"2021-06-05T03:50:49Z\",\"endSearchTime\":\"2021-10-30T10:52:42Z\",\"sourceTable\":\"wxrt\",\"azureAsyncOperationId\":\"dxepxgyq\"},\"restoredLogs\":{\"startRestoreTime\":\"2021-11-27T06:03:21Z\",\"endRestoreTime\":\"2020-12-28T18:07:39Z\",\"sourceTable\":\"pkukghi\",\"azureAsyncOperationId\":\"blxgwimf\"},\"resultStatistics\":{\"progress\":41.899403,\"ingestedRecords\":510557599,\"scannedGb\":39.004253},\"plan\":\"Auxiliary\",\"lastPlanModifiedDate\":\"kfoqreyfkzikfj\",\"schema\":{\"name\":\"eaivxwczel\",\"displayName\":\"irels\",\"description\":\"aenwabf\",\"columns\":[{}],\"standardColumns\":[{},{},{},{}],\"categories\":[\"bjhwuaan\",\"zjosp\",\"youlp\",\"rvxaglrvimjwosy\"],\"labels\":[\"tcs\"],\"source\":\"customer\",\"tableType\":\"Microsoft\",\"tableSubType\":\"Classic\",\"solutions\":[\"ekkezzikhlyfjh\",\"gqggebdunygae\"]},\"provisioningState\":\"Updating\",\"retentionInDaysAsDefault\":true,\"totalRetentionInDaysAsDefault\":false},\"id\":\"pxllrx\",\"name\":\"yjmoadsu\",\"type\":\"arm\"}]}") .toObject(TablesListResult.class); - Assertions.assertEquals(1152356837, model.value().get(0).retentionInDays()); - Assertions.assertEquals(230467636, model.value().get(0).totalRetentionInDays()); - Assertions.assertEquals("fmviklby", model.value().get(0).searchResults().query()); - Assertions.assertEquals("khbejdznxc", model.value().get(0).searchResults().description()); - Assertions.assertEquals(2045200930, model.value().get(0).searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T18:49:59Z"), + Assertions.assertEquals(288092317, model.value().get(0).retentionInDays()); + Assertions.assertEquals(1703781779, model.value().get(0).totalRetentionInDays()); + Assertions.assertEquals("bwwift", model.value().get(0).searchResults().query()); + Assertions.assertEquals("qkvpuvksgplsakn", model.value().get(0).searchResults().description()); + Assertions.assertEquals(792282663, model.value().get(0).searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T07:41:08Z"), model.value().get(0).searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T21:57:15Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T05:17:19Z"), model.value().get(0).searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T22:04:39Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T10:26:48Z"), model.value().get(0).restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T02:20:30Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T08:44:45Z"), model.value().get(0).restoredLogs().endRestoreTime()); - Assertions.assertEquals("amtmcz", model.value().get(0).restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.value().get(0).plan()); - Assertions.assertEquals("jpr", model.value().get(0).schema().name()); - Assertions.assertEquals("wcfzqljyxgt", model.value().get(0).schema().displayName()); - Assertions.assertEquals("heyd", model.value().get(0).schema().description()); + Assertions.assertEquals("srmslyzr", model.value().get(0).restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.BASIC, model.value().get(0).plan()); + Assertions.assertEquals("smypyynpc", model.value().get(0).schema().name()); + Assertions.assertEquals("umnzgmwznmabik", model.value().get(0).schema().displayName()); + Assertions.assertEquals("orgjhxbldt", model.value().get(0).schema().description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { TablesListResult model = new TablesListResult().withValue(Arrays.asList( - new TableInner().withRetentionInDays(1152356837) - .withTotalRetentionInDays(230467636) - .withSearchResults(new SearchResults().withQuery("fmviklby") - .withDescription("khbejdznxc") - .withLimit(2045200930) - .withStartSearchTime(OffsetDateTime.parse("2021-03-13T18:49:59Z")) - .withEndSearchTime(OffsetDateTime.parse("2020-12-24T21:57:15Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-11-05T22:04:39Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-04-12T02:20:30Z")) - .withSourceTable("amtmcz")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("jpr") - .withDisplayName("wcfzqljyxgt") - .withDescription("heyd") - .withColumns(Arrays.asList(new Column(), new Column(), new Column(), new Column()))), - new TableInner().withRetentionInDays(328293320) - .withTotalRetentionInDays(1039197688) - .withSearchResults(new SearchResults().withQuery("vleo") - .withDescription("ml") - .withLimit(16475569) - .withStartSearchTime(OffsetDateTime.parse("2021-06-03T05:33:27Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-06-07T14:08:39Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-05-25T11:37:10Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-04-19T19:49:12Z")) - .withSourceTable("gzslesjcbhernnti")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("vhmxtdrjfu") - .withDisplayName("coebjvewzcj") - .withDescription("m") - .withColumns(Arrays.asList(new Column(), new Column(), new Column(), new Column()))), - new TableInner().withRetentionInDays(476504183) - .withTotalRetentionInDays(681185824) - .withSearchResults(new SearchResults().withQuery("nhxmsi") - .withDescription("omi") - .withLimit(1723847557) - .withStartSearchTime(OffsetDateTime.parse("2021-10-29T08:24:04Z")) - .withEndSearchTime(OffsetDateTime.parse("2021-01-25T20:05:05Z"))) - .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-05-03T11:29:59Z")) - .withEndRestoreTime(OffsetDateTime.parse("2021-05-09T21:38:39Z")) - .withSourceTable("cubiipuipw")) - .withPlan(TablePlanEnum.ANALYTICS) - .withSchema(new Schema().withName("wdxsm") - .withDisplayName("cwrwfs") - .withDescription("fnynszqujizdvoqy") - .withColumns(Arrays.asList(new Column(), new Column(), new Column(), new Column()))))); + new TableInner().withRetentionInDays(288092317) + .withTotalRetentionInDays(1703781779) + .withSearchResults(new SearchResults().withQuery("bwwift") + .withDescription("qkvpuvksgplsakn") + .withLimit(792282663) + .withStartSearchTime(OffsetDateTime.parse("2021-08-07T07:41:08Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-04-07T05:17:19Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-07-03T10:26:48Z")) + .withEndRestoreTime(OffsetDateTime.parse("2021-08-13T08:44:45Z")) + .withSourceTable("srmslyzr")) + .withPlan(TablePlanEnum.BASIC) + .withSchema(new Schema().withName("smypyynpc") + .withDisplayName("umnzgmwznmabik") + .withDescription("orgjhxbldt") + .withColumns(Arrays.asList(new Column(), new Column()))), + new TableInner().withRetentionInDays(817024636) + .withTotalRetentionInDays(467483193) + .withSearchResults(new SearchResults().withQuery("healmfmtda") + .withDescription("gdv") + .withLimit(1689077175) + .withStartSearchTime(OffsetDateTime.parse("2021-06-05T03:50:49Z")) + .withEndSearchTime(OffsetDateTime.parse("2021-10-30T10:52:42Z"))) + .withRestoredLogs(new RestoredLogs().withStartRestoreTime(OffsetDateTime.parse("2021-11-27T06:03:21Z")) + .withEndRestoreTime(OffsetDateTime.parse("2020-12-28T18:07:39Z")) + .withSourceTable("pkukghi")) + .withPlan(TablePlanEnum.AUXILIARY) + .withSchema(new Schema().withName("eaivxwczel") + .withDisplayName("irels") + .withDescription("aenwabf") + .withColumns(Arrays.asList(new Column()))))); model = BinaryData.fromObject(model).toObject(TablesListResult.class); - Assertions.assertEquals(1152356837, model.value().get(0).retentionInDays()); - Assertions.assertEquals(230467636, model.value().get(0).totalRetentionInDays()); - Assertions.assertEquals("fmviklby", model.value().get(0).searchResults().query()); - Assertions.assertEquals("khbejdznxc", model.value().get(0).searchResults().description()); - Assertions.assertEquals(2045200930, model.value().get(0).searchResults().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-03-13T18:49:59Z"), + Assertions.assertEquals(288092317, model.value().get(0).retentionInDays()); + Assertions.assertEquals(1703781779, model.value().get(0).totalRetentionInDays()); + Assertions.assertEquals("bwwift", model.value().get(0).searchResults().query()); + Assertions.assertEquals("qkvpuvksgplsakn", model.value().get(0).searchResults().description()); + Assertions.assertEquals(792282663, model.value().get(0).searchResults().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-08-07T07:41:08Z"), model.value().get(0).searchResults().startSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2020-12-24T21:57:15Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-04-07T05:17:19Z"), model.value().get(0).searchResults().endSearchTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-11-05T22:04:39Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-07-03T10:26:48Z"), model.value().get(0).restoredLogs().startRestoreTime()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-12T02:20:30Z"), + Assertions.assertEquals(OffsetDateTime.parse("2021-08-13T08:44:45Z"), model.value().get(0).restoredLogs().endRestoreTime()); - Assertions.assertEquals("amtmcz", model.value().get(0).restoredLogs().sourceTable()); - Assertions.assertEquals(TablePlanEnum.ANALYTICS, model.value().get(0).plan()); - Assertions.assertEquals("jpr", model.value().get(0).schema().name()); - Assertions.assertEquals("wcfzqljyxgt", model.value().get(0).schema().displayName()); - Assertions.assertEquals("heyd", model.value().get(0).schema().description()); + Assertions.assertEquals("srmslyzr", model.value().get(0).restoredLogs().sourceTable()); + Assertions.assertEquals(TablePlanEnum.BASIC, model.value().get(0).plan()); + Assertions.assertEquals("smypyynpc", model.value().get(0).schema().name()); + Assertions.assertEquals("umnzgmwznmabik", model.value().get(0).schema().displayName()); + Assertions.assertEquals("orgjhxbldt", model.value().get(0).schema().description()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java index 3872b158eb39..684c8b69cd1c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TablesMigrateWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testMigrateWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.tables().migrateWithResponse("sl", "bnsmjkwynqxaek", "sykvwjtqpke", com.azure.core.util.Context.NONE); + manager.tables().migrateWithResponse("g", "uuj", "ouhdawsigrb", com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java index af7fd1879930..273d2dc25289 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagTests.java @@ -11,17 +11,16 @@ public final class TagTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - Tag model - = BinaryData.fromString("{\"name\":\"fiwjmygtdssls\",\"value\":\"tmweriofzpyq\"}").toObject(Tag.class); - Assertions.assertEquals("fiwjmygtdssls", model.name()); - Assertions.assertEquals("tmweriofzpyq", model.value()); + Tag model = BinaryData.fromString("{\"name\":\"qeqxo\",\"value\":\"z\"}").toObject(Tag.class); + Assertions.assertEquals("qeqxo", model.name()); + Assertions.assertEquals("z", model.value()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - Tag model = new Tag().withName("fiwjmygtdssls").withValue("tmweriofzpyq"); + Tag model = new Tag().withName("qeqxo").withValue("z"); model = BinaryData.fromObject(model).toObject(Tag.class); - Assertions.assertEquals("fiwjmygtdssls", model.name()); - Assertions.assertEquals("tmweriofzpyq", model.value()); + Assertions.assertEquals("qeqxo", model.name()); + Assertions.assertEquals("z", model.value()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java index cb53b4fa5d85..b1800956571d 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/TagsResourceTests.java @@ -13,18 +13,19 @@ public final class TagsResourceTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - TagsResource model = BinaryData.fromString( - "{\"tags\":{\"jakhmsbzjh\":\"fdfdosygexpa\",\"hqtrgqjbpf\":\"rzevdphlxaol\",\"tfell\":\"fsinzgvfcjrwzoxx\",\"lxofpdvhpfxxypin\":\"wfzitonpeqfpjk\"}}") + TagsResource model = BinaryData + .fromString( + "{\"tags\":{\"fhzovawjvzunluth\":\"vu\",\"rnxipei\":\"n\",\"e\":\"pjzu\",\"kzbbtd\":\"xdult\"}}") .toObject(TagsResource.class); - Assertions.assertEquals("fdfdosygexpa", model.tags().get("jakhmsbzjh")); + Assertions.assertEquals("vu", model.tags().get("fhzovawjvzunluth")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - TagsResource model = new TagsResource().withTags(mapOf("jakhmsbzjh", "fdfdosygexpa", "hqtrgqjbpf", - "rzevdphlxaol", "tfell", "fsinzgvfcjrwzoxx", "lxofpdvhpfxxypin", "wfzitonpeqfpjk")); + TagsResource model = new TagsResource() + .withTags(mapOf("fhzovawjvzunluth", "vu", "rnxipei", "n", "e", "pjzu", "kzbbtd", "xdult")); model = BinaryData.fromObject(model).toObject(TagsResource.class); - Assertions.assertEquals("fdfdosygexpa", model.tags().get("jakhmsbzjh")); + Assertions.assertEquals("vu", model.tags().get("fhzovawjvzunluth")); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java index fa04531153b7..b9f09fd2a085 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsageMetricInnerTests.java @@ -14,33 +14,33 @@ public final class UsageMetricInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UsageMetricInner model = BinaryData.fromString( - "{\"name\":{\"value\":\"yjsflhhcaalnji\",\"localizedValue\":\"sxyawjoyaqcs\"},\"unit\":\"jpkiidzyexznelix\",\"currentValue\":16.42737179588487,\"limit\":65.0090874045316,\"nextResetTime\":\"2021-01-11T05:27:37Z\",\"quotaPeriod\":\"nxknalaulp\"}") + "{\"name\":{\"value\":\"hmtnvy\",\"localizedValue\":\"atkzwpcnpw\"},\"unit\":\"jaesgvvsccya\",\"currentValue\":7.14281993849214,\"limit\":21.496629598428008,\"nextResetTime\":\"2021-07-19T23:39:28Z\",\"quotaPeriod\":\"lvdnkfx\"}") .toObject(UsageMetricInner.class); - Assertions.assertEquals("yjsflhhcaalnji", model.name().value()); - Assertions.assertEquals("sxyawjoyaqcs", model.name().localizedValue()); - Assertions.assertEquals("jpkiidzyexznelix", model.unit()); - Assertions.assertEquals(16.42737179588487D, model.currentValue()); - Assertions.assertEquals(65.0090874045316D, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T05:27:37Z"), model.nextResetTime()); - Assertions.assertEquals("nxknalaulp", model.quotaPeriod()); + Assertions.assertEquals("hmtnvy", model.name().value()); + Assertions.assertEquals("atkzwpcnpw", model.name().localizedValue()); + Assertions.assertEquals("jaesgvvsccya", model.unit()); + Assertions.assertEquals(7.14281993849214D, model.currentValue()); + Assertions.assertEquals(21.496629598428008D, model.limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-19T23:39:28Z"), model.nextResetTime()); + Assertions.assertEquals("lvdnkfx", model.quotaPeriod()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - UsageMetricInner model = new UsageMetricInner() - .withName(new MetricName().withValue("yjsflhhcaalnji").withLocalizedValue("sxyawjoyaqcs")) - .withUnit("jpkiidzyexznelix") - .withCurrentValue(16.42737179588487D) - .withLimit(65.0090874045316D) - .withNextResetTime(OffsetDateTime.parse("2021-01-11T05:27:37Z")) - .withQuotaPeriod("nxknalaulp"); + UsageMetricInner model + = new UsageMetricInner().withName(new MetricName().withValue("hmtnvy").withLocalizedValue("atkzwpcnpw")) + .withUnit("jaesgvvsccya") + .withCurrentValue(7.14281993849214D) + .withLimit(21.496629598428008D) + .withNextResetTime(OffsetDateTime.parse("2021-07-19T23:39:28Z")) + .withQuotaPeriod("lvdnkfx"); model = BinaryData.fromObject(model).toObject(UsageMetricInner.class); - Assertions.assertEquals("yjsflhhcaalnji", model.name().value()); - Assertions.assertEquals("sxyawjoyaqcs", model.name().localizedValue()); - Assertions.assertEquals("jpkiidzyexznelix", model.unit()); - Assertions.assertEquals(16.42737179588487D, model.currentValue()); - Assertions.assertEquals(65.0090874045316D, model.limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-01-11T05:27:37Z"), model.nextResetTime()); - Assertions.assertEquals("nxknalaulp", model.quotaPeriod()); + Assertions.assertEquals("hmtnvy", model.name().value()); + Assertions.assertEquals("atkzwpcnpw", model.name().localizedValue()); + Assertions.assertEquals("jaesgvvsccya", model.unit()); + Assertions.assertEquals(7.14281993849214D, model.currentValue()); + Assertions.assertEquals(21.496629598428008D, model.limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-19T23:39:28Z"), model.nextResetTime()); + Assertions.assertEquals("lvdnkfx", model.quotaPeriod()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java index b9d7b5598b38..22c9edcecbae 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UsagesListMockTests.java @@ -7,8 +7,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.UsageMetric; @@ -22,25 +22,25 @@ public final class UsagesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"name\":{\"value\":\"gtuhxuicbu\",\"localizedValue\":\"mr\"},\"unit\":\"njlx\",\"currentValue\":33.720955848019294,\"limit\":33.504071266925294,\"nextResetTime\":\"2021-07-24T18:32:54Z\",\"quotaPeriod\":\"baqehgpdoh\"}]}"; + = "{\"value\":[{\"name\":{\"value\":\"yshtuwgmev\",\"localizedValue\":\"fpwzyifrkgwltx\"},\"unit\":\"ipxgzdy\",\"currentValue\":99.77270946016633,\"limit\":29.475698926269988,\"nextResetTime\":\"2021-07-01T11:25:11Z\",\"quotaPeriod\":\"avkjog\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.usages().list("vuwkasiziesfuugh", "uqfecj", com.azure.core.util.Context.NONE); + = manager.usages().list("hmx", "fdsajred", com.azure.core.util.Context.NONE); - Assertions.assertEquals("gtuhxuicbu", response.iterator().next().name().value()); - Assertions.assertEquals("mr", response.iterator().next().name().localizedValue()); - Assertions.assertEquals("njlx", response.iterator().next().unit()); - Assertions.assertEquals(33.720955848019294D, response.iterator().next().currentValue()); - Assertions.assertEquals(33.504071266925294D, response.iterator().next().limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-07-24T18:32:54Z"), + Assertions.assertEquals("yshtuwgmev", response.iterator().next().name().value()); + Assertions.assertEquals("fpwzyifrkgwltx", response.iterator().next().name().localizedValue()); + Assertions.assertEquals("ipxgzdy", response.iterator().next().unit()); + Assertions.assertEquals(99.77270946016633D, response.iterator().next().currentValue()); + Assertions.assertEquals(29.475698926269988D, response.iterator().next().limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-07-01T11:25:11Z"), response.iterator().next().nextResetTime()); - Assertions.assertEquals("baqehgpdoh", response.iterator().next().quotaPeriod()); + Assertions.assertEquals("avkjog", response.iterator().next().quotaPeriod()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java index 7fa169399014..8399d678232c 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserAssignedIdentityTests.java @@ -11,7 +11,7 @@ public final class UserAssignedIdentityTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"9a09bc28-de09-4353-9fc8-db8f188d440e\",\"clientId\":\"2a023bcc-682d-4e62-8c52-90b378bd07e0\"}") + "{\"principalId\":\"a2e47de8-c396-46a0-8fe5-8358df136d56\",\"clientId\":\"4d52d02f-e515-4f1f-94dd-463d488059fb\"}") .toObject(UserAssignedIdentity.class); } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java index 848bc06680c5..159cb494681f 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/UserIdentityPropertiesTests.java @@ -10,8 +10,9 @@ public final class UserIdentityPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - UserIdentityProperties model = BinaryData.fromString("{\"principalId\":\"ithtywu\",\"clientId\":\"cbihwqk\"}") - .toObject(UserIdentityProperties.class); + UserIdentityProperties model + = BinaryData.fromString("{\"principalId\":\"ozauorsukokwb\",\"clientId\":\"lhlv\"}") + .toObject(UserIdentityProperties.class); } @org.junit.jupiter.api.Test diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java index f30f22bd72ac..1c6d3ad017b3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceCappingTests.java @@ -12,15 +12,15 @@ public final class WorkspaceCappingTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceCapping model = BinaryData.fromString( - "{\"dailyQuotaGb\":30.97995124606966,\"quotaNextResetTime\":\"nqttezl\",\"dataIngestionStatus\":\"OverQuota\"}") + "{\"dailyQuotaGb\":87.67426402803734,\"quotaNextResetTime\":\"qtqzfavyv\",\"dataIngestionStatus\":\"RespectQuota\"}") .toObject(WorkspaceCapping.class); - Assertions.assertEquals(30.97995124606966D, model.dailyQuotaGb()); + Assertions.assertEquals(87.67426402803734D, model.dailyQuotaGb()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceCapping model = new WorkspaceCapping().withDailyQuotaGb(30.97995124606966D); + WorkspaceCapping model = new WorkspaceCapping().withDailyQuotaGb(87.67426402803734D); model = BinaryData.fromObject(model).toObject(WorkspaceCapping.class); - Assertions.assertEquals(30.97995124606966D, model.dailyQuotaGb()); + Assertions.assertEquals(87.67426402803734D, model.dailyQuotaGb()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFailoverPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFailoverPropertiesTests.java new file mode 100644 index 000000000000..156ca6ac7ba2 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFailoverPropertiesTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; + +public final class WorkspaceFailoverPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceFailoverProperties model + = BinaryData.fromString("{\"state\":\"Deactivating\",\"lastModifiedDate\":\"2021-10-19T23:18:49Z\"}") + .toObject(WorkspaceFailoverProperties.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceFailoverProperties model = new WorkspaceFailoverProperties(); + model = BinaryData.fromObject(model).toObject(WorkspaceFailoverProperties.class); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java index a9e3443e9578..2f695f282279 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceFeaturesTests.java @@ -5,6 +5,8 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; import java.util.HashMap; import java.util.Map; @@ -14,29 +16,33 @@ public final class WorkspaceFeaturesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceFeatures model = BinaryData.fromString( - "{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"wau\",\"disableLocalAuth\":false,\"\":{\"pevzhfst\":\"datagupkvipmdscwxq\",\"pelmcuvhixbjxyf\":\"datatxhojujb\"}}") + "{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"jcbhern\",\"disableLocalAuth\":false,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"cv\"],\"ehwagoh\":\"datawr\",\"xtdr\":\"datauffkmrqemvvh\",\"znmwcp\":\"datafutacoebjvewzc\"}") .toObject(WorkspaceFeatures.class); - Assertions.assertEquals(false, model.enableDataExport()); - Assertions.assertEquals(false, model.immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("wau", model.clusterResourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); + Assertions.assertTrue(model.enableDataExport()); + Assertions.assertTrue(model.immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("jcbhern", model.clusterResourceId()); + Assertions.assertFalse(model.disableLocalAuth()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceFeatures model = new WorkspaceFeatures().withEnableDataExport(false) - .withImmediatePurgeDataOn30Days(false) + WorkspaceFeatures model = new WorkspaceFeatures().withEnableDataExport(true) + .withImmediatePurgeDataOn30Days(true) .withEnableLogAccessUsingOnlyResourcePermissions(true) - .withClusterResourceId("wau") + .withClusterResourceId("jcbhern") .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf()); + .withAdditionalProperties(mapOf("associations", + JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"cv\"]", Object.class, SerializerEncoding.JSON), + "xtdr", "datauffkmrqemvvh", "ehwagoh", "datawr", "znmwcp", "datafutacoebjvewzc", + "unifiedSentinelBillingOnly", false)); model = BinaryData.fromObject(model).toObject(WorkspaceFeatures.class); - Assertions.assertEquals(false, model.enableDataExport()); - Assertions.assertEquals(false, model.immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("wau", model.clusterResourceId()); - Assertions.assertEquals(false, model.disableLocalAuth()); + Assertions.assertTrue(model.enableDataExport()); + Assertions.assertTrue(model.immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("jcbhern", model.clusterResourceId()); + Assertions.assertFalse(model.disableLocalAuth()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java index 78bf785bc5b7..12632a0568a3 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceInnerTests.java @@ -5,14 +5,17 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.util.HashMap; @@ -23,67 +26,75 @@ public final class WorkspaceInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceInner model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Canceled\",\"customerId\":\"jylwbtlhflsj\",\"sku\":{\"name\":\"PerNode\",\"capacityReservationLevel\":500,\"lastSkuUpdate\":\"jvfbgofelja\"},\"retentionInDays\":728576378,\"workspaceCapping\":{\"dailyQuotaGb\":44.315075801765715,\"quotaNextResetTime\":\"vriiio\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"ghfkvtvsexs\",\"modifiedDate\":\"ueluqhhahhxvrhmz\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"ghftqsxhqxujxuk\",\"scopeId\":\"xdigrjg\"},{\"resourceId\":\"fzdm\",\"scopeId\":\"qtfihwhbotzinga\"},{\"resourceId\":\"pph\",\"scopeId\":\"zqzudph\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"nwcvtbvkayhmtnv\",\"disableLocalAuth\":true,\"\":{\"cjaesgvvs\":\"datakzwpcnpw\",\"wygzlvdnkfxusem\":\"datacyajguqf\",\"pfcqdp\":\"datawzrmuh\"}},\"defaultDataCollectionRuleResourceId\":\"xqv\"},\"identity\":{\"principalId\":\"uoymgccelvezry\",\"tenantId\":\"lmfeokerq\",\"type\":\"managedIdentity\",\"userAssignedIdentities\":{\"pbqpcrfkbwccsn\":{\"principalId\":\"ob\",\"clientId\":\"gxedkow\"},\"y\":{\"principalId\":\"cdwxlpq\",\"clientId\":\"ftnkhtj\"},\"ywkbirryuzhlhkjo\":{\"principalId\":\"gwfqatmt\",\"clientId\":\"tmdvypgikdgs\"}}},\"systemData\":{\"createdBy\":\"qqaatjinrvgou\",\"createdByType\":\"Key\",\"createdAt\":\"2021-11-16T07:49:22Z\",\"lastModifiedBy\":\"fggjioolvr\",\"lastModifiedByType\":\"Application\",\"lastModifiedAt\":\"2021-10-02T02:42:21Z\"},\"etag\":\"k\",\"location\":\"llqwjygvjayvblmh\",\"tags\":{\"gsopbyrqufegxu\":\"uhbxvvy\",\"bnhlmc\":\"wz\",\"dn\":\"l\",\"ijejvegrhbpn\":\"itvgbmhrixkwm\"},\"id\":\"ixexcc\",\"name\":\"dreaxh\",\"type\":\"exdrrvqahqkg\"}") + "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"gthrrghxjbdhq\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":441101019,\"lastSkuUpdate\":\"2021-08-03T04:18:25Z\"},\"retentionInDays\":469495787,\"workspaceCapping\":{\"dailyQuotaGb\":81.1170037569868,\"quotaNextResetTime\":\"hrnsvbu\",\"dataIngestionStatus\":\"SubscriptionSuspended\"},\"createdDate\":\"2021-09-08T03:32:01Z\",\"modifiedDate\":\"2021-07-28T13:53:22Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"rtkfawnopq\",\"scopeId\":\"kyzirtxdyux\"},{\"resourceId\":\"jntpsewgioilqu\",\"scopeId\":\"ydxtqm\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"f\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"ghhavgrvkffo\",\"jzhpjbibgjmfx\",\"mv\"],\"nbkfezzxscy\":\"datauyovw\",\"vzzbtdcq\":\"datawzdgirujbzbo\",\"dshf\":\"datapniyujviyl\",\"fmwncotmrfh\":\"datasnrbgyefrymsgao\"},\"defaultDataCollectionRuleResourceId\":\"ctymoxoftp\",\"replication\":{\"location\":\"wycz\",\"enabled\":false,\"provisioningState\":\"DisableRequested\",\"createdDate\":\"2021-11-29T08:27:09Z\",\"lastModifiedDate\":\"2021-01-05T07:46:41Z\"},\"failover\":{\"state\":\"Inactive\",\"lastModifiedDate\":\"2021-07-16T17:01:10Z\"}},\"identity\":{\"principalId\":\"skasdvlmfwdgzxu\",\"tenantId\":\"cvpa\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"jn\":{\"principalId\":\"uzvx\",\"clientId\":\"i\"},\"cesutrgjupauut\":{\"principalId\":\"ytxifqjzgxmrh\",\"clientId\":\"lw\"},\"pnfqntcyp\":{\"principalId\":\"oqh\",\"clientId\":\"ejqgw\"}}},\"etag\":\"vfoimwksli\",\"location\":\"cizjxvydfceacvl\",\"tags\":{\"jslb\":\"gdyftumrtwna\",\"aeqphchqnr\":\"wkojgcyztsfmzn\",\"wrykqgai\":\"rpxeh\"},\"id\":\"mvikl\",\"name\":\"ydv\",\"type\":\"hbejdznxcvdsrhnj\"}") .toObject(WorkspaceInner.class); - Assertions.assertEquals("llqwjygvjayvblmh", model.location()); - Assertions.assertEquals("uhbxvvy", model.tags().get("gsopbyrqufegxu")); - Assertions.assertEquals(IdentityType.MANAGED_IDENTITY, model.identity().type()); - Assertions.assertEquals("k", model.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(728576378, model.retentionInDays()); - Assertions.assertEquals(44.315075801765715D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals("cizjxvydfceacvl", model.location()); + Assertions.assertEquals("gdyftumrtwna", model.tags().get("jslb")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("vfoimwksli", model.etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); + Assertions.assertEquals(441101019, model.sku().capacityReservationLevel()); + Assertions.assertEquals(469495787, model.retentionInDays()); + Assertions.assertEquals(81.1170037569868D, model.workspaceCapping().dailyQuotaGb()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(false, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("nwcvtbvkayhmtnv", model.features().clusterResourceId()); - Assertions.assertEquals(true, model.features().disableLocalAuth()); - Assertions.assertEquals("xqv", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertFalse(model.features().enableDataExport()); + Assertions.assertFalse(model.features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("f", model.features().clusterResourceId()); + Assertions.assertTrue(model.features().disableLocalAuth()); + Assertions.assertEquals("ctymoxoftp", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("wycz", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceInner model = new WorkspaceInner().withLocation("llqwjygvjayvblmh") - .withTags(mapOf("gsopbyrqufegxu", "uhbxvvy", "bnhlmc", "wz", "dn", "l", "ijejvegrhbpn", "itvgbmhrixkwm")) - .withIdentity(new Identity().withType(IdentityType.MANAGED_IDENTITY) - .withUserAssignedIdentities(mapOf("pbqpcrfkbwccsn", new UserIdentityProperties(), "y", - new UserIdentityProperties(), "ywkbirryuzhlhkjo", new UserIdentityProperties()))) - .withEtag("k") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_NODE) - .withCapacityReservationLevel(CapacityReservationLevel.FIVE_ZERO_ZERO)) - .withRetentionInDays(728576378) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(44.315075801765715D)) + WorkspaceInner model = new WorkspaceInner().withLocation("cizjxvydfceacvl") + .withTags(mapOf("jslb", "gdyftumrtwna", "aeqphchqnr", "wkojgcyztsfmzn", "wrykqgai", "rpxeh")) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("jn", new UserIdentityProperties(), "cesutrgjupauut", + new UserIdentityProperties(), "pnfqntcyp", new UserIdentityProperties()))) + .withEtag("vfoimwksli") + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE).withCapacityReservationLevel(441101019)) + .withRetentionInDays(469495787) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(81.1170037569868D)) .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.DISABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) .withForceCmkForQuery(true) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) + .withFeatures(new WorkspaceFeatures().withEnableDataExport(false) .withImmediatePurgeDataOn30Days(false) .withEnableLogAccessUsingOnlyResourcePermissions(true) - .withClusterResourceId("nwcvtbvkayhmtnv") + .withClusterResourceId("f") .withDisableLocalAuth(true) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("xqv"); + .withAdditionalProperties(mapOf("associations", JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"ghhavgrvkffo\",\"jzhpjbibgjmfx\",\"mv\"]", Object.class, SerializerEncoding.JSON), + "dshf", "datapniyujviyl", "vzzbtdcq", "datawzdgirujbzbo", "unifiedSentinelBillingOnly", false, + "nbkfezzxscy", "datauyovw", "fmwncotmrfh", "datasnrbgyefrymsgao"))) + .withDefaultDataCollectionRuleResourceId("ctymoxoftp") + .withReplication(new WorkspaceReplicationProperties().withLocation("wycz").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()); model = BinaryData.fromObject(model).toObject(WorkspaceInner.class); - Assertions.assertEquals("llqwjygvjayvblmh", model.location()); - Assertions.assertEquals("uhbxvvy", model.tags().get("gsopbyrqufegxu")); - Assertions.assertEquals(IdentityType.MANAGED_IDENTITY, model.identity().type()); - Assertions.assertEquals("k", model.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(728576378, model.retentionInDays()); - Assertions.assertEquals(44.315075801765715D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals("cizjxvydfceacvl", model.location()); + Assertions.assertEquals("gdyftumrtwna", model.tags().get("jslb")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, model.identity().type()); + Assertions.assertEquals("vfoimwksli", model.etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); + Assertions.assertEquals(441101019, model.sku().capacityReservationLevel()); + Assertions.assertEquals(469495787, model.retentionInDays()); + Assertions.assertEquals(81.1170037569868D, model.workspaceCapping().dailyQuotaGb()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(false, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("nwcvtbvkayhmtnv", model.features().clusterResourceId()); - Assertions.assertEquals(true, model.features().disableLocalAuth()); - Assertions.assertEquals("xqv", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertFalse(model.features().enableDataExport()); + Assertions.assertFalse(model.features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("f", model.features().clusterResourceId()); + Assertions.assertTrue(model.features().disableLocalAuth()); + Assertions.assertEquals("ctymoxoftp", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("wycz", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java index 951ae07adcae..ebca78d665ab 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListManagementGroupsResultTests.java @@ -15,61 +15,45 @@ public final class WorkspaceListManagementGroupsResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceListManagementGroupsResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"serverCount\":319916389,\"isGateway\":false,\"name\":\"elmqk\",\"id\":\"ahvljuaha\",\"created\":\"2021-02-11T00:39:32Z\",\"dataReceived\":\"2021-02-06T01:31:14Z\",\"version\":\"mdua\",\"sku\":\"exq\"}},{\"properties\":{\"serverCount\":792525510,\"isGateway\":true,\"name\":\"sr\",\"id\":\"gvxp\",\"created\":\"2021-07-02T00:35:52Z\",\"dataReceived\":\"2021-02-22T15:36:44Z\",\"version\":\"fmisg\",\"sku\":\"nbbelda\"}},{\"properties\":{\"serverCount\":1782633502,\"isGateway\":true,\"name\":\"ourqhakau\",\"id\":\"shsfwxosowzxcu\",\"created\":\"2021-06-04T05:08:46Z\",\"dataReceived\":\"2020-12-22T21:46:37Z\",\"version\":\"xdje\",\"sku\":\"pucwwfvovbvme\"}},{\"properties\":{\"serverCount\":1911093580,\"isGateway\":false,\"name\":\"zceuojgjrw\",\"id\":\"eiotwmcdytdx\",\"created\":\"2021-01-14T13:52:52Z\",\"dataReceived\":\"2021-04-02T04:04:33Z\",\"version\":\"jawgqwg\",\"sku\":\"ni\"}}]}") + "{\"value\":[{\"properties\":{\"serverCount\":2119983807,\"isGateway\":true,\"name\":\"jjugwdkcglhslaz\",\"id\":\"yggdtjixh\",\"created\":\"2021-11-28T10:21:02Z\",\"dataReceived\":\"2021-03-09T09:26:42Z\",\"version\":\"wey\",\"sku\":\"menevfyexfwh\"}},{\"properties\":{\"serverCount\":148650220,\"isGateway\":false,\"name\":\"vdcsitynn\",\"id\":\"mdectehfiqscjey\",\"created\":\"2021-03-08T20:07:33Z\",\"dataReceived\":\"2021-01-16T02:36:56Z\",\"version\":\"kgqhcjrefovg\",\"sku\":\"qsl\"}}]}") .toObject(WorkspaceListManagementGroupsResult.class); - Assertions.assertEquals(319916389, model.value().get(0).serverCount()); - Assertions.assertEquals(false, model.value().get(0).isGateway()); - Assertions.assertEquals("elmqk", model.value().get(0).name()); - Assertions.assertEquals("ahvljuaha", model.value().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T00:39:32Z"), model.value().get(0).created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T01:31:14Z"), model.value().get(0).dataReceived()); - Assertions.assertEquals("mdua", model.value().get(0).version()); - Assertions.assertEquals("exq", model.value().get(0).sku()); + Assertions.assertEquals(2119983807, model.value().get(0).serverCount()); + Assertions.assertTrue(model.value().get(0).isGateway()); + Assertions.assertEquals("jjugwdkcglhslaz", model.value().get(0).name()); + Assertions.assertEquals("yggdtjixh", model.value().get(0).id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-28T10:21:02Z"), model.value().get(0).created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-09T09:26:42Z"), model.value().get(0).dataReceived()); + Assertions.assertEquals("wey", model.value().get(0).version()); + Assertions.assertEquals("menevfyexfwh", model.value().get(0).sku()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { WorkspaceListManagementGroupsResult model = new WorkspaceListManagementGroupsResult().withValue(Arrays.asList( - new ManagementGroupInner().withServerCount(319916389) - .withIsGateway(false) - .withName("elmqk") - .withId("ahvljuaha") - .withCreated(OffsetDateTime.parse("2021-02-11T00:39:32Z")) - .withDataReceived(OffsetDateTime.parse("2021-02-06T01:31:14Z")) - .withVersion("mdua") - .withSku("exq"), - new ManagementGroupInner().withServerCount(792525510) - .withIsGateway(true) - .withName("sr") - .withId("gvxp") - .withCreated(OffsetDateTime.parse("2021-07-02T00:35:52Z")) - .withDataReceived(OffsetDateTime.parse("2021-02-22T15:36:44Z")) - .withVersion("fmisg") - .withSku("nbbelda"), - new ManagementGroupInner().withServerCount(1782633502) + new ManagementGroupInner().withServerCount(2119983807) .withIsGateway(true) - .withName("ourqhakau") - .withId("shsfwxosowzxcu") - .withCreated(OffsetDateTime.parse("2021-06-04T05:08:46Z")) - .withDataReceived(OffsetDateTime.parse("2020-12-22T21:46:37Z")) - .withVersion("xdje") - .withSku("pucwwfvovbvme"), - new ManagementGroupInner().withServerCount(1911093580) + .withName("jjugwdkcglhslaz") + .withId("yggdtjixh") + .withCreated(OffsetDateTime.parse("2021-11-28T10:21:02Z")) + .withDataReceived(OffsetDateTime.parse("2021-03-09T09:26:42Z")) + .withVersion("wey") + .withSku("menevfyexfwh"), + new ManagementGroupInner().withServerCount(148650220) .withIsGateway(false) - .withName("zceuojgjrw") - .withId("eiotwmcdytdx") - .withCreated(OffsetDateTime.parse("2021-01-14T13:52:52Z")) - .withDataReceived(OffsetDateTime.parse("2021-04-02T04:04:33Z")) - .withVersion("jawgqwg") - .withSku("ni"))); + .withName("vdcsitynn") + .withId("mdectehfiqscjey") + .withCreated(OffsetDateTime.parse("2021-03-08T20:07:33Z")) + .withDataReceived(OffsetDateTime.parse("2021-01-16T02:36:56Z")) + .withVersion("kgqhcjrefovg") + .withSku("qsl"))); model = BinaryData.fromObject(model).toObject(WorkspaceListManagementGroupsResult.class); - Assertions.assertEquals(319916389, model.value().get(0).serverCount()); - Assertions.assertEquals(false, model.value().get(0).isGateway()); - Assertions.assertEquals("elmqk", model.value().get(0).name()); - Assertions.assertEquals("ahvljuaha", model.value().get(0).id()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-11T00:39:32Z"), model.value().get(0).created()); - Assertions.assertEquals(OffsetDateTime.parse("2021-02-06T01:31:14Z"), model.value().get(0).dataReceived()); - Assertions.assertEquals("mdua", model.value().get(0).version()); - Assertions.assertEquals("exq", model.value().get(0).sku()); + Assertions.assertEquals(2119983807, model.value().get(0).serverCount()); + Assertions.assertTrue(model.value().get(0).isGateway()); + Assertions.assertEquals("jjugwdkcglhslaz", model.value().get(0).name()); + Assertions.assertEquals("yggdtjixh", model.value().get(0).id()); + Assertions.assertEquals(OffsetDateTime.parse("2021-11-28T10:21:02Z"), model.value().get(0).created()); + Assertions.assertEquals(OffsetDateTime.parse("2021-03-09T09:26:42Z"), model.value().get(0).dataReceived()); + Assertions.assertEquals("wey", model.value().get(0).version()); + Assertions.assertEquals("menevfyexfwh", model.value().get(0).sku()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java index 5b7de28373ff..733c111eac29 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListResultTests.java @@ -5,15 +5,18 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceInner; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; import com.azure.resourcemanager.loganalytics.models.WorkspaceListResult; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.util.Arrays; @@ -25,98 +28,107 @@ public final class WorkspaceListResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"provisioningState\":\"Creating\",\"customerId\":\"rvtp\",\"sku\":{\"name\":\"CapacityReservation\",\"capacityReservationLevel\":300,\"lastSkuUpdate\":\"lgkfbt\"},\"retentionInDays\":2059272755,\"workspaceCapping\":{\"dailyQuotaGb\":3.405125193957159,\"quotaNextResetTime\":\"jcntuj\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"ed\",\"modifiedDate\":\"wwa\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"foqouicybx\",\"scopeId\":\"zg\"},{\"resourceId\":\"ufoxc\",\"scopeId\":\"opidoamciodh\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"bon\",\"disableLocalAuth\":false,\"\":{\"exztvbtq\":\"dataegokdwbwhkszzcmr\",\"wtl\":\"datasfraoyzko\",\"uximerqfobw\":\"datanguxawqaldsy\"}},\"defaultDataCollectionRuleResourceId\":\"nkbykutwpfhp\"},\"identity\":{\"principalId\":\"hrskdsnfd\",\"tenantId\":\"oakgtdlmkkzev\",\"type\":\"application\",\"userAssignedIdentities\":{\"m\":{\"principalId\":\"pusdstt\",\"clientId\":\"ogvbbejdcngq\"},\"grtwae\":{\"principalId\":\"kufgmj\",\"clientId\":\"wr\"},\"efozbhdms\":{\"principalId\":\"uzkopbminrfd\",\"clientId\":\"yuhhziu\"},\"z\":{\"principalId\":\"mzqhoftrmaequi\",\"clientId\":\"xicslfao\"}}},\"systemData\":{\"createdBy\":\"ylhalnswhcc\",\"createdByType\":\"User\",\"createdAt\":\"2021-06-09T09:48:38Z\",\"lastModifiedBy\":\"vwitqscyw\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-02-13T16:07:26Z\"},\"etag\":\"uhczbwemh\",\"location\":\"i\",\"tags\":{\"w\":\"rgzdwmsweyp\"},\"id\":\"xggicccnxqhuexmk\",\"name\":\"tlstvlzywem\",\"type\":\"zrncsdt\"},{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"ypbsfgytguslfead\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":500,\"lastSkuUpdate\":\"yhejhzisxgfp\"},\"retentionInDays\":1351567723,\"workspaceCapping\":{\"dailyQuotaGb\":12.05090295018133,\"quotaNextResetTime\":\"srp\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"zraehtwd\",\"modifiedDate\":\"ftswibyrcdlbhsh\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"ty\",\"scopeId\":\"evxccedcp\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"xltjcvnhltiu\",\"disableLocalAuth\":false,\"\":{\"y\":\"datavvwxqi\",\"djrkvfgbvfvpd\":\"dataunyowxwl\"}},\"defaultDataCollectionRuleResourceId\":\"daciz\"},\"identity\":{\"principalId\":\"lhkrribdeibqipqk\",\"tenantId\":\"vxndz\",\"type\":\"user\",\"userAssignedIdentities\":{\"sjabibs\":{\"principalId\":\"fajpjorwk\",\"clientId\":\"yhgbijtjivfx\"},\"budurgkakmo\":{\"principalId\":\"tawfsdjpvkvp\",\"clientId\":\"xbkzbzkdvncj\"},\"lgzrfzeeyeb\":{\"principalId\":\"hjjklff\",\"clientId\":\"ouw\"},\"t\":{\"principalId\":\"ikayuhqlbjbsybb\",\"clientId\":\"r\"}}},\"systemData\":{\"createdBy\":\"mfpgv\",\"createdByType\":\"Key\",\"createdAt\":\"2021-10-24T06:37:57Z\",\"lastModifiedBy\":\"ltha\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-09-03T05:44:20Z\"},\"etag\":\"wutwbdsre\",\"location\":\"pdrhne\",\"tags\":{\"cgpik\":\"wqkdwytisibi\",\"av\":\"zimejzanlfzx\",\"jq\":\"mbzonokix\"},\"id\":\"irgzp\",\"name\":\"rlazszrnw\",\"type\":\"iin\"}]}") + "{\"value\":[{\"properties\":{\"provisioningState\":\"ProvisioningAccount\",\"customerId\":\"mtdh\",\"sku\":{\"name\":\"Standalone\",\"capacityReservationLevel\":1330472875,\"lastSkuUpdate\":\"2021-08-05T12:13:03Z\"},\"retentionInDays\":811019553,\"workspaceCapping\":{\"dailyQuotaGb\":64.53231022171681,\"quotaNextResetTime\":\"w\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"2021-12-09T01:29:35Z\",\"modifiedDate\":\"2021-03-20T05:32:50Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"SecuredByPerimeter\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"vqqaatjinrvgo\",\"scopeId\":\"mfiibfggj\"},{\"resourceId\":\"olvrw\",\"scopeId\":\"v\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"ygvjayvblmh\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":true,\"associations\":[\"vvyhg\"],\"uvwzfbnh\":\"databyrqufeg\",\"bmhrixkwmyijejv\":\"datamctlpdngitv\",\"ixexcc\":\"datagrhbpn\"},\"defaultDataCollectionRuleResourceId\":\"reaxhcexdr\",\"replication\":{\"location\":\"ahqkg\",\"enabled\":false,\"provisioningState\":\"DisableRequested\",\"createdDate\":\"2021-04-30T07:00:15Z\",\"lastModifiedDate\":\"2021-07-07T03:58:09Z\"},\"failover\":{\"state\":\"Failed\",\"lastModifiedDate\":\"2021-09-16T08:46:35Z\"}},\"identity\":{\"principalId\":\"z\",\"tenantId\":\"voowvr\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"yhgfipnsx\":{\"principalId\":\"qp\",\"clientId\":\"ostronz\"},\"gumhjglikkxws\":{\"principalId\":\"cwaekrrjre\",\"clientId\":\"xt\"}}},\"etag\":\"bq\",\"location\":\"vuzlm\",\"tags\":{\"noigbrnjwmwk\":\"lfktgplcrpwjxe\"},\"id\":\"nbsazejjoqkag\",\"name\":\"hsxttaugzxnf\",\"type\":\"azpxdtnkdmkqjjl\"},{\"properties\":{\"provisioningState\":\"ProvisioningAccount\",\"customerId\":\"rkpyouaibrebqaay\",\"sku\":{\"name\":\"PerGB2018\",\"capacityReservationLevel\":1330578772,\"lastSkuUpdate\":\"2021-11-17T18:36:32Z\"},\"retentionInDays\":2018222858,\"workspaceCapping\":{\"dailyQuotaGb\":15.097379092743646,\"quotaNextResetTime\":\"wfff\",\"dataIngestionStatus\":\"SubscriptionSuspended\"},\"createdDate\":\"2021-01-19T04:30:49Z\",\"modifiedDate\":\"2021-03-20T06:33:49Z\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"jihy\",\"scopeId\":\"zphv\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"upkvipmdsc\",\"disableLocalAuth\":false,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"zhfstot\",\"hojujbypelmcuv\",\"ixbjx\"],\"lrcoolsttpki\":\"datan\"},\"defaultDataCollectionRuleResourceId\":\"kbnujr\",\"replication\":{\"location\":\"tylbfpncurdoiw\",\"enabled\":false,\"provisioningState\":\"Succeeded\",\"createdDate\":\"2021-05-04T20:05:44Z\",\"lastModifiedDate\":\"2021-07-16T11:50:04Z\"},\"failover\":{\"state\":\"Deactivating\",\"lastModifiedDate\":\"2021-08-12T00:10:56Z\"}},\"identity\":{\"principalId\":\"knfd\",\"tenantId\":\"wjchrdg\",\"type\":\"None\",\"userAssignedIdentities\":{\"tsbwtovvtgse\":{\"principalId\":\"mwctondzjluudfd\",\"clientId\":\"gg\"}}},\"etag\":\"fiufx\",\"location\":\"knpirgnepttwq\",\"tags\":{\"rxfrddhc\":\"iffcdmqnrojlpijn\",\"ronasxift\":\"atiz\",\"zh\":\"zq\"},\"id\":\"tw\",\"name\":\"sgogczhonnxk\",\"type\":\"lgnyhmo\"}]}") .toObject(WorkspaceListResult.class); - Assertions.assertEquals("i", model.value().get(0).location()); - Assertions.assertEquals("rgzdwmsweyp", model.value().get(0).tags().get("w")); - Assertions.assertEquals(IdentityType.APPLICATION, model.value().get(0).identity().type()); - Assertions.assertEquals("uhczbwemh", model.value().get(0).etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.value().get(0).sku().name()); - Assertions.assertEquals(CapacityReservationLevel.THREE_ZERO_ZERO, - model.value().get(0).sku().capacityReservationLevel()); - Assertions.assertEquals(2059272755, model.value().get(0).retentionInDays()); - Assertions.assertEquals(3.405125193957159D, model.value().get(0).workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals("vuzlm", model.value().get(0).location()); + Assertions.assertEquals("lfktgplcrpwjxe", model.value().get(0).tags().get("noigbrnjwmwk")); + Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("bq", model.value().get(0).etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.value().get(0).sku().name()); + Assertions.assertEquals(1330472875, model.value().get(0).sku().capacityReservationLevel()); + Assertions.assertEquals(811019553, model.value().get(0).retentionInDays()); + Assertions.assertEquals(64.53231022171681D, model.value().get(0).workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.value().get(0).forceCmkForQuery()); - Assertions.assertEquals(true, model.value().get(0).features().enableDataExport()); - Assertions.assertEquals(true, model.value().get(0).features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("bon", model.value().get(0).features().clusterResourceId()); - Assertions.assertEquals(false, model.value().get(0).features().disableLocalAuth()); - Assertions.assertEquals("nkbykutwpfhp", model.value().get(0).defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, + model.value().get(0).publicNetworkAccessForQuery()); + Assertions.assertTrue(model.value().get(0).forceCmkForQuery()); + Assertions.assertFalse(model.value().get(0).features().enableDataExport()); + Assertions.assertTrue(model.value().get(0).features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("ygvjayvblmh", model.value().get(0).features().clusterResourceId()); + Assertions.assertTrue(model.value().get(0).features().disableLocalAuth()); + Assertions.assertEquals("reaxhcexdr", model.value().get(0).defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("ahqkg", model.value().get(0).replication().location()); + Assertions.assertFalse(model.value().get(0).replication().enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceListResult model - = new WorkspaceListResult() - .withValue( - Arrays - .asList( - new WorkspaceInner().withLocation("i") - .withTags(mapOf("w", "rgzdwmsweyp")) - .withIdentity(new Identity().withType(IdentityType.APPLICATION) - .withUserAssignedIdentities(mapOf("m", new UserIdentityProperties(), "grtwae", - new UserIdentityProperties(), "efozbhdms", new UserIdentityProperties(), "z", - new UserIdentityProperties()))) - .withEtag("uhczbwemh") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.CAPACITY_RESERVATION) - .withCapacityReservationLevel(CapacityReservationLevel.THREE_ZERO_ZERO)) - .withRetentionInDays(2059272755) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(3.405125193957159D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("bon") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("nkbykutwpfhp"), - new WorkspaceInner().withLocation("pdrhne") - .withTags(mapOf("cgpik", "wqkdwytisibi", "av", "zimejzanlfzx", "jq", "mbzonokix")) - .withIdentity(new Identity().withType(IdentityType.USER) - .withUserAssignedIdentities(mapOf("sjabibs", new UserIdentityProperties(), - "budurgkakmo", new UserIdentityProperties(), "lgzrfzeeyeb", - new UserIdentityProperties(), "t", new UserIdentityProperties()))) - .withEtag("wutwbdsre") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE) - .withCapacityReservationLevel(CapacityReservationLevel.FIVE_ZERO_ZERO)) - .withRetentionInDays(1351567723) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(12.05090295018133D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("xltjcvnhltiu") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("daciz"))); + WorkspaceListResult model = new WorkspaceListResult().withValue(Arrays.asList( + new WorkspaceInner().withLocation("vuzlm") + .withTags(mapOf("noigbrnjwmwk", "lfktgplcrpwjxe")) + .withIdentity(new Identity().withType(IdentityType.SYSTEM_ASSIGNED) + .withUserAssignedIdentities(mapOf("yhgfipnsx", new UserIdentityProperties(), "gumhjglikkxws", + new UserIdentityProperties()))) + .withEtag("bq") + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.STANDALONE) + .withCapacityReservationLevel(1330472875)) + .withRetentionInDays(811019553) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(64.53231022171681D)) + .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.DISABLED) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.SECURED_BY_PERIMETER) + .withForceCmkForQuery(true) + .withFeatures(new WorkspaceFeatures().withEnableDataExport(false) + .withImmediatePurgeDataOn30Days(true) + .withEnableLogAccessUsingOnlyResourcePermissions(true) + .withClusterResourceId("ygvjayvblmh") + .withDisableLocalAuth(true) + .withAdditionalProperties(mapOf("associations", + JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"vvyhg\"]", Object.class, SerializerEncoding.JSON), + "ixexcc", "datagrhbpn", "uvwzfbnh", "databyrqufeg", "bmhrixkwmyijejv", "datamctlpdngitv", + "unifiedSentinelBillingOnly", true))) + .withDefaultDataCollectionRuleResourceId("reaxhcexdr") + .withReplication(new WorkspaceReplicationProperties().withLocation("ahqkg").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()), + new WorkspaceInner().withLocation("knpirgnepttwq") + .withTags(mapOf("rxfrddhc", "iffcdmqnrojlpijn", "ronasxift", "atiz", "zh", "zq")) + .withIdentity(new Identity().withType(IdentityType.NONE) + .withUserAssignedIdentities(mapOf("tsbwtovvtgse", new UserIdentityProperties()))) + .withEtag("fiufx") + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018) + .withCapacityReservationLevel(1330578772)) + .withRetentionInDays(2018222858) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(15.097379092743646D)) + .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) + .withForceCmkForQuery(false) + .withFeatures(new WorkspaceFeatures().withEnableDataExport(false) + .withImmediatePurgeDataOn30Days(false) + .withEnableLogAccessUsingOnlyResourcePermissions(false) + .withClusterResourceId("upkvipmdsc") + .withDisableLocalAuth(false) + .withAdditionalProperties(mapOf("associations", + JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"zhfstot\",\"hojujbypelmcuv\",\"ixbjx\"]", Object.class, + SerializerEncoding.JSON), + "lrcoolsttpki", "datan", "unifiedSentinelBillingOnly", false))) + .withDefaultDataCollectionRuleResourceId("kbnujr") + .withReplication(new WorkspaceReplicationProperties().withLocation("tylbfpncurdoiw").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()))); model = BinaryData.fromObject(model).toObject(WorkspaceListResult.class); - Assertions.assertEquals("i", model.value().get(0).location()); - Assertions.assertEquals("rgzdwmsweyp", model.value().get(0).tags().get("w")); - Assertions.assertEquals(IdentityType.APPLICATION, model.value().get(0).identity().type()); - Assertions.assertEquals("uhczbwemh", model.value().get(0).etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.value().get(0).sku().name()); - Assertions.assertEquals(CapacityReservationLevel.THREE_ZERO_ZERO, - model.value().get(0).sku().capacityReservationLevel()); - Assertions.assertEquals(2059272755, model.value().get(0).retentionInDays()); - Assertions.assertEquals(3.405125193957159D, model.value().get(0).workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, + Assertions.assertEquals("vuzlm", model.value().get(0).location()); + Assertions.assertEquals("lfktgplcrpwjxe", model.value().get(0).tags().get("noigbrnjwmwk")); + Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.value().get(0).identity().type()); + Assertions.assertEquals("bq", model.value().get(0).etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.value().get(0).sku().name()); + Assertions.assertEquals(1330472875, model.value().get(0).sku().capacityReservationLevel()); + Assertions.assertEquals(811019553, model.value().get(0).retentionInDays()); + Assertions.assertEquals(64.53231022171681D, model.value().get(0).workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.value().get(0).publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.value().get(0).forceCmkForQuery()); - Assertions.assertEquals(true, model.value().get(0).features().enableDataExport()); - Assertions.assertEquals(true, model.value().get(0).features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("bon", model.value().get(0).features().clusterResourceId()); - Assertions.assertEquals(false, model.value().get(0).features().disableLocalAuth()); - Assertions.assertEquals("nkbykutwpfhp", model.value().get(0).defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, + model.value().get(0).publicNetworkAccessForQuery()); + Assertions.assertTrue(model.value().get(0).forceCmkForQuery()); + Assertions.assertFalse(model.value().get(0).features().enableDataExport()); + Assertions.assertTrue(model.value().get(0).features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(model.value().get(0).features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("ygvjayvblmh", model.value().get(0).features().clusterResourceId()); + Assertions.assertTrue(model.value().get(0).features().disableLocalAuth()); + Assertions.assertEquals("reaxhcexdr", model.value().get(0).defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("ahqkg", model.value().get(0).replication().location()); + Assertions.assertFalse(model.value().get(0).replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java index 606d57e1a4bc..c1a080838866 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceListUsagesResultTests.java @@ -16,45 +16,51 @@ public final class WorkspaceListUsagesResultTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceListUsagesResult model = BinaryData.fromString( - "{\"value\":[{\"name\":{\"value\":\"ibycno\",\"localizedValue\":\"knme\"},\"unit\":\"sgzvahapjyzhpv\",\"currentValue\":87.25675780401417,\"limit\":55.97471576867415,\"nextResetTime\":\"2021-04-03T19:52:37Z\",\"quotaPeriod\":\"zlmwlxkvugfhz\"},{\"name\":{\"value\":\"wjvzunluthnn\",\"localizedValue\":\"nxipeil\"},\"unit\":\"zuaejxd\",\"currentValue\":90.33601925524867,\"limit\":73.93279017728112,\"nextResetTime\":\"2021-04-25T18:40:13Z\",\"quotaPeriod\":\"zumveekgpwo\"},{\"name\":{\"value\":\"kfpbs\",\"localizedValue\":\"ofd\"},\"unit\":\"uusdttouwa\",\"currentValue\":45.35057543626068,\"limit\":0.5889681397022062,\"nextResetTime\":\"2021-03-07T10:01:38Z\",\"quotaPeriod\":\"smv\"}]}") + "{\"value\":[{\"name\":{\"value\":\"zrnw\",\"localizedValue\":\"indfpwpjyl\"},\"unit\":\"tlhflsjcdhszf\",\"currentValue\":93.507310013303,\"limit\":23.397589490400428,\"nextResetTime\":\"2021-12-07T09:36:22Z\",\"quotaPeriod\":\"a\"},{\"name\":{\"value\":\"mqhldvrii\",\"localizedValue\":\"jnalghf\"},\"unit\":\"tvsexsowuel\",\"currentValue\":95.82653467641371,\"limit\":72.21038300276933,\"nextResetTime\":\"2021-10-26T13:34:39Z\",\"quotaPeriod\":\"hmzk\"},{\"name\":{\"value\":\"g\",\"localizedValue\":\"spughftqsxhq\"},\"unit\":\"j\",\"currentValue\":65.12505098321063,\"limit\":37.6190498251855,\"nextResetTime\":\"2021-06-03T19:27:08Z\",\"quotaPeriod\":\"jguufzdm\"},{\"name\":{\"value\":\"tfih\",\"localizedValue\":\"botzingamvppho\"},\"unit\":\"qzudphq\",\"currentValue\":82.02103115304786,\"limit\":77.5366363877876,\"nextResetTime\":\"2021-09-19T17:28Z\",\"quotaPeriod\":\"cvtbv\"}]}") .toObject(WorkspaceListUsagesResult.class); - Assertions.assertEquals("ibycno", model.value().get(0).name().value()); - Assertions.assertEquals("knme", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("sgzvahapjyzhpv", model.value().get(0).unit()); - Assertions.assertEquals(87.25675780401417D, model.value().get(0).currentValue()); - Assertions.assertEquals(55.97471576867415D, model.value().get(0).limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T19:52:37Z"), model.value().get(0).nextResetTime()); - Assertions.assertEquals("zlmwlxkvugfhz", model.value().get(0).quotaPeriod()); + Assertions.assertEquals("zrnw", model.value().get(0).name().value()); + Assertions.assertEquals("indfpwpjyl", model.value().get(0).name().localizedValue()); + Assertions.assertEquals("tlhflsjcdhszf", model.value().get(0).unit()); + Assertions.assertEquals(93.507310013303D, model.value().get(0).currentValue()); + Assertions.assertEquals(23.397589490400428D, model.value().get(0).limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T09:36:22Z"), model.value().get(0).nextResetTime()); + Assertions.assertEquals("a", model.value().get(0).quotaPeriod()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { WorkspaceListUsagesResult model = new WorkspaceListUsagesResult().withValue(Arrays.asList( - new UsageMetricInner().withName(new MetricName().withValue("ibycno").withLocalizedValue("knme")) - .withUnit("sgzvahapjyzhpv") - .withCurrentValue(87.25675780401417D) - .withLimit(55.97471576867415D) - .withNextResetTime(OffsetDateTime.parse("2021-04-03T19:52:37Z")) - .withQuotaPeriod("zlmwlxkvugfhz"), - new UsageMetricInner().withName(new MetricName().withValue("wjvzunluthnn").withLocalizedValue("nxipeil")) - .withUnit("zuaejxd") - .withCurrentValue(90.33601925524867D) - .withLimit(73.93279017728112D) - .withNextResetTime(OffsetDateTime.parse("2021-04-25T18:40:13Z")) - .withQuotaPeriod("zumveekgpwo"), - new UsageMetricInner().withName(new MetricName().withValue("kfpbs").withLocalizedValue("ofd")) - .withUnit("uusdttouwa") - .withCurrentValue(45.35057543626068D) - .withLimit(0.5889681397022062D) - .withNextResetTime(OffsetDateTime.parse("2021-03-07T10:01:38Z")) - .withQuotaPeriod("smv"))); + new UsageMetricInner().withName(new MetricName().withValue("zrnw").withLocalizedValue("indfpwpjyl")) + .withUnit("tlhflsjcdhszf") + .withCurrentValue(93.507310013303D) + .withLimit(23.397589490400428D) + .withNextResetTime(OffsetDateTime.parse("2021-12-07T09:36:22Z")) + .withQuotaPeriod("a"), + new UsageMetricInner().withName(new MetricName().withValue("mqhldvrii").withLocalizedValue("jnalghf")) + .withUnit("tvsexsowuel") + .withCurrentValue(95.82653467641371D) + .withLimit(72.21038300276933D) + .withNextResetTime(OffsetDateTime.parse("2021-10-26T13:34:39Z")) + .withQuotaPeriod("hmzk"), + new UsageMetricInner().withName(new MetricName().withValue("g").withLocalizedValue("spughftqsxhq")) + .withUnit("j") + .withCurrentValue(65.12505098321063D) + .withLimit(37.6190498251855D) + .withNextResetTime(OffsetDateTime.parse("2021-06-03T19:27:08Z")) + .withQuotaPeriod("jguufzdm"), + new UsageMetricInner().withName(new MetricName().withValue("tfih").withLocalizedValue("botzingamvppho")) + .withUnit("qzudphq") + .withCurrentValue(82.02103115304786D) + .withLimit(77.5366363877876D) + .withNextResetTime(OffsetDateTime.parse("2021-09-19T17:28Z")) + .withQuotaPeriod("cvtbv"))); model = BinaryData.fromObject(model).toObject(WorkspaceListUsagesResult.class); - Assertions.assertEquals("ibycno", model.value().get(0).name().value()); - Assertions.assertEquals("knme", model.value().get(0).name().localizedValue()); - Assertions.assertEquals("sgzvahapjyzhpv", model.value().get(0).unit()); - Assertions.assertEquals(87.25675780401417D, model.value().get(0).currentValue()); - Assertions.assertEquals(55.97471576867415D, model.value().get(0).limit()); - Assertions.assertEquals(OffsetDateTime.parse("2021-04-03T19:52:37Z"), model.value().get(0).nextResetTime()); - Assertions.assertEquals("zlmwlxkvugfhz", model.value().get(0).quotaPeriod()); + Assertions.assertEquals("zrnw", model.value().get(0).name().value()); + Assertions.assertEquals("indfpwpjyl", model.value().get(0).name().localizedValue()); + Assertions.assertEquals("tlhflsjcdhszf", model.value().get(0).unit()); + Assertions.assertEquals(93.507310013303D, model.value().get(0).currentValue()); + Assertions.assertEquals(23.397589490400428D, model.value().get(0).limit()); + Assertions.assertEquals(OffsetDateTime.parse("2021-12-07T09:36:22Z"), model.value().get(0).nextResetTime()); + Assertions.assertEquals("a", model.value().get(0).quotaPeriod()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java index 8ceab0bfee2f..84df62623801 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePatchTests.java @@ -5,14 +5,17 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; import com.azure.resourcemanager.loganalytics.models.WorkspacePatch; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.util.HashMap; @@ -23,62 +26,70 @@ public final class WorkspacePatchTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspacePatch model = BinaryData.fromString( - "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"gg\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":1000,\"lastSkuUpdate\":\"ovvtgseinqfiu\"},\"retentionInDays\":846707727,\"workspaceCapping\":{\"dailyQuotaGb\":67.63985202806066,\"quotaNextResetTime\":\"gnepttwqmsni\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"mqnrojlpijnkr\",\"modifiedDate\":\"rddh\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"asxifto\",\"scopeId\":\"yzhftwesgogczh\"},{\"resourceId\":\"nxkrlgnyhmossxkk\",\"scopeId\":\"h\"},{\"resourceId\":\"gh\",\"scopeId\":\"bdhqxvcxgf\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"rnsvbuswd\",\"disableLocalAuth\":false,\"\":{\"awnopqgikyzirtxd\":\"dataycnunvjsrtk\",\"ioilqukrydxtq\":\"datauxzejntpsew\",\"ghhavgrvkffo\":\"dataieoxorggufhyaomt\",\"mv\":\"datajzhpjbibgjmfx\"}},\"defaultDataCollectionRuleResourceId\":\"luyovwxnbkfezzx\"},\"identity\":{\"principalId\":\"hwzdgirujbz\",\"tenantId\":\"mvzzbtdcqvp\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"cotmr\":{\"principalId\":\"viylwdshfssnrbgy\",\"clientId\":\"rymsgaojfmw\"},\"cpqjlihhyu\":{\"principalId\":\"irctymoxoftpipiw\",\"clientId\":\"zuhx\"},\"rsre\":{\"principalId\":\"skasdvlmfwdgzxu\",\"clientId\":\"cvpa\"}}},\"tags\":{\"ifqjz\":\"xurisjnhnyt\",\"lw\":\"xmrhu\",\"woqhihe\":\"cesutrgjupauut\",\"zpnfqntcypsxj\":\"qg\"},\"etag\":\"oimwkslirc\",\"id\":\"zjxvydfcea\",\"name\":\"vlhv\",\"type\":\"gdyftumrtwna\"}") + "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"zlrphwzs\",\"sku\":{\"name\":\"PerGB2018\",\"capacityReservationLevel\":1354895276,\"lastSkuUpdate\":\"2021-05-13T15:08:20Z\"},\"retentionInDays\":2112519300,\"workspaceCapping\":{\"dailyQuotaGb\":34.97869271736046,\"quotaNextResetTime\":\"nrwrbiork\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"2021-03-04T00:16:10Z\",\"modifiedDate\":\"2021-04-15T08:16:25Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"v\",\"scopeId\":\"miloxggdufiqndie\"},{\"resourceId\":\"ao\",\"scopeId\":\"chvcyyysfgdo\"},{\"resourceId\":\"ubiipuipwoqonma\",\"scopeId\":\"ekni\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"ev\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"ilbywdxsm\",\"ccwr\"],\"n\":\"datacj\",\"voqyt\":\"datanszqujiz\"},\"defaultDataCollectionRuleResourceId\":\"yo\",\"replication\":{\"location\":\"lgy\",\"enabled\":false,\"provisioningState\":\"Failed\",\"createdDate\":\"2021-06-15T10:26:37Z\",\"lastModifiedDate\":\"2021-11-07T15:05:03Z\"},\"failover\":{\"state\":\"Failed\",\"lastModifiedDate\":\"2021-01-31T04:26:46Z\"}},\"identity\":{\"principalId\":\"sbpimlq\",\"tenantId\":\"jxkcgxxlxsff\",\"type\":\"None\",\"userAssignedIdentities\":{\"sgow\":{\"principalId\":\"qzdwlvwlyoup\",\"clientId\":\"fbkjubdyhgkfmi\"},\"tg\":{\"principalId\":\"ttsttktlahbqact\",\"clientId\":\"gzukxitmm\"},\"isavok\":{\"principalId\":\"q\",\"clientId\":\"rnxrxcpj\"},\"rqttbajlkatnw\":{\"principalId\":\"zfvazi\",\"clientId\":\"l\"}}},\"tags\":{\"cxkdmligovi\":\"opidkqqfkuv\",\"goorbteo\":\"rxkpmloazuruoc\"},\"etag\":\"fhjxakvvjgs\",\"id\":\"ordilmywwtkgkxny\",\"name\":\"dabg\",\"type\":\"vudtjuewbcihx\"}") .toObject(WorkspacePatch.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xurisjnhnyt", model.tags().get("ifqjz")); - Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(846707727, model.retentionInDays()); - Assertions.assertEquals(67.63985202806066D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(false, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("rnsvbuswd", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("luyovwxnbkfezzx", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(IdentityType.NONE, model.identity().type()); + Assertions.assertEquals("opidkqqfkuv", model.tags().get("cxkdmligovi")); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_GB2018, model.sku().name()); + Assertions.assertEquals(1354895276, model.sku().capacityReservationLevel()); + Assertions.assertEquals(2112519300, model.retentionInDays()); + Assertions.assertEquals(34.97869271736046D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, model.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertFalse(model.features().enableDataExport()); + Assertions.assertFalse(model.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("ev", model.features().clusterResourceId()); + Assertions.assertTrue(model.features().disableLocalAuth()); + Assertions.assertEquals("yo", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("lgy", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspacePatch model = new WorkspacePatch() - .withIdentity(new Identity().withType(IdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities(mapOf("cotmr", new UserIdentityProperties(), "cpqjlihhyu", - new UserIdentityProperties(), "rsre", new UserIdentityProperties()))) - .withTags(mapOf("ifqjz", "xurisjnhnyt", "lw", "xmrhu", "woqhihe", "cesutrgjupauut", "zpnfqntcypsxj", "qg")) - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE) - .withCapacityReservationLevel(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO)) - .withRetentionInDays(846707727) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(67.63985202806066D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) + WorkspacePatch model = new WorkspacePatch().withIdentity(new Identity().withType(IdentityType.NONE) + .withUserAssignedIdentities(mapOf("sgow", new UserIdentityProperties(), "tg", new UserIdentityProperties(), + "isavok", new UserIdentityProperties(), "rqttbajlkatnw", new UserIdentityProperties()))) + .withTags(mapOf("cxkdmligovi", "opidkqqfkuv", "goorbteo", "rxkpmloazuruoc")) + .withSku( + new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_GB2018).withCapacityReservationLevel(1354895276)) + .withRetentionInDays(2112519300) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(34.97869271736046D)) + .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.SECURED_BY_PERIMETER) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) .withForceCmkForQuery(true) .withFeatures(new WorkspaceFeatures().withEnableDataExport(false) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(true) - .withClusterResourceId("rnsvbuswd") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("luyovwxnbkfezzx"); + .withImmediatePurgeDataOn30Days(false) + .withEnableLogAccessUsingOnlyResourcePermissions(false) + .withClusterResourceId("ev") + .withDisableLocalAuth(true) + .withAdditionalProperties(mapOf("associations", + JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"ilbywdxsm\",\"ccwr\"]", Object.class, SerializerEncoding.JSON), + "voqyt", "datanszqujiz", "unifiedSentinelBillingOnly", false, "n", "datacj"))) + .withDefaultDataCollectionRuleResourceId("yo") + .withReplication(new WorkspaceReplicationProperties().withLocation("lgy").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()); model = BinaryData.fromObject(model).toObject(WorkspacePatch.class); - Assertions.assertEquals(IdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xurisjnhnyt", model.tags().get("ifqjz")); - Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(846707727, model.retentionInDays()); - Assertions.assertEquals(67.63985202806066D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, model.forceCmkForQuery()); - Assertions.assertEquals(false, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("rnsvbuswd", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("luyovwxnbkfezzx", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(IdentityType.NONE, model.identity().type()); + Assertions.assertEquals("opidkqqfkuv", model.tags().get("cxkdmligovi")); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_GB2018, model.sku().name()); + Assertions.assertEquals(1354895276, model.sku().capacityReservationLevel()); + Assertions.assertEquals(2112519300, model.retentionInDays()); + Assertions.assertEquals(34.97869271736046D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, model.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertFalse(model.features().enableDataExport()); + Assertions.assertFalse(model.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("ev", model.features().clusterResourceId()); + Assertions.assertTrue(model.features().disableLocalAuth()); + Assertions.assertEquals("yo", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("lgy", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java index 760774d464ae..74c47ce168c6 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePropertiesTests.java @@ -5,11 +5,14 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.fluent.models.WorkspaceProperties; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.util.HashMap; @@ -20,54 +23,63 @@ public final class WorkspacePropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspaceProperties model = BinaryData.fromString( - "{\"provisioningState\":\"ProvisioningAccount\",\"customerId\":\"ijnhyjsvfycxzbf\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":2000,\"lastSkuUpdate\":\"vmtgjqppy\"},\"retentionInDays\":768184156,\"workspaceCapping\":{\"dailyQuotaGb\":15.525265144439715,\"quotaNextResetTime\":\"yhgfipnsx\",\"dataIngestionStatus\":\"ForceOff\"},\"createdDate\":\"a\",\"modifiedDate\":\"rrjreafxtsgu\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"slol\",\"scopeId\":\"pvuzlmv\"},{\"resourceId\":\"lfktgplcrpwjxe\",\"scopeId\":\"oi\"},{\"resourceId\":\"rnjwmw\",\"scopeId\":\"nbsazejjoqkag\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"zxnfaaz\",\"disableLocalAuth\":false,\"\":{\"ou\":\"datakdmkqjjlwuenvrkp\"}},\"defaultDataCollectionRuleResourceId\":\"bre\"}") + "{\"provisioningState\":\"Deleting\",\"customerId\":\"v\",\"sku\":{\"name\":\"PerNode\",\"capacityReservationLevel\":1036527354,\"lastSkuUpdate\":\"2021-03-30T03:00:35Z\"},\"retentionInDays\":1960555856,\"workspaceCapping\":{\"dailyQuotaGb\":74.87413920302748,\"quotaNextResetTime\":\"uljltduceamtmcz\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"2021-10-02T15:37:14Z\",\"modifiedDate\":\"2021-01-27T20:06:14Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"xmojmsvpkjp\",\"scopeId\":\"kwcf\"},{\"resourceId\":\"ljyxgtczhe\",\"scopeId\":\"bsdshmkxmaehvbbx\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"tbaxk\",\"disableLocalAuth\":false,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"pyklyhpluodpvru\",\"dlgzibthostgkt\"],\"lhpl\":\"datadxeclzedqbcvh\",\"lkxt\":\"datadqkdlwwqfbu\"},\"defaultDataCollectionRuleResourceId\":\"jfsmlmbtxhwgfwsr\",\"replication\":{\"location\":\"coezbrhubskh\",\"enabled\":false,\"provisioningState\":\"Succeeded\",\"createdDate\":\"2021-02-04T04:44:46Z\",\"lastModifiedDate\":\"2021-10-06T17:04:50Z\"},\"failover\":{\"state\":\"Failed\",\"lastModifiedDate\":\"2021-07-12T13:05:01Z\"}}") .toObject(WorkspaceProperties.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(768184156, model.retentionInDays()); - Assertions.assertEquals(15.525265144439715D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("zxnfaaz", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("bre", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); + Assertions.assertEquals(1036527354, model.sku().capacityReservationLevel()); + Assertions.assertEquals(1960555856, model.retentionInDays()); + Assertions.assertEquals(74.87413920302748D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, model.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertTrue(model.features().enableDataExport()); + Assertions.assertTrue(model.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("tbaxk", model.features().clusterResourceId()); + Assertions.assertFalse(model.features().disableLocalAuth()); + Assertions.assertEquals("jfsmlmbtxhwgfwsr", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("coezbrhubskh", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceProperties model = new WorkspaceProperties() - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.LACLUSTER) - .withCapacityReservationLevel(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO)) - .withRetentionInDays(768184156) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(15.525265144439715D)) - .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.DISABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) - .withForceCmkForQuery(false) - .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("zxnfaaz") - .withDisableLocalAuth(false) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("bre"); + WorkspaceProperties model + = new WorkspaceProperties() + .withSku( + new WorkspaceSku().withName(WorkspaceSkuNameEnum.PER_NODE).withCapacityReservationLevel(1036527354)) + .withRetentionInDays(1960555856) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(74.87413920302748D)) + .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.SECURED_BY_PERIMETER) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.DISABLED) + .withForceCmkForQuery(true) + .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) + .withImmediatePurgeDataOn30Days(true) + .withEnableLogAccessUsingOnlyResourcePermissions(false) + .withClusterResourceId("tbaxk") + .withDisableLocalAuth(false) + .withAdditionalProperties(mapOf("associations", JacksonAdapter.createDefaultSerializerAdapter() + .deserialize("[\"pyklyhpluodpvru\",\"dlgzibthostgkt\"]", Object.class, SerializerEncoding.JSON), + "lkxt", "datadqkdlwwqfbu", "lhpl", "datadxeclzedqbcvh", "unifiedSentinelBillingOnly", false))) + .withDefaultDataCollectionRuleResourceId("jfsmlmbtxhwgfwsr") + .withReplication(new WorkspaceReplicationProperties().withLocation("coezbrhubskh").withEnabled(false)) + .withFailover(new WorkspaceFailoverProperties()); model = BinaryData.fromObject(model).toObject(WorkspaceProperties.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, model.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO, model.sku().capacityReservationLevel()); - Assertions.assertEquals(768184156, model.retentionInDays()); - Assertions.assertEquals(15.525265144439715D, model.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, model.publicNetworkAccessForQuery()); - Assertions.assertEquals(false, model.forceCmkForQuery()); - Assertions.assertEquals(true, model.features().enableDataExport()); - Assertions.assertEquals(true, model.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, model.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("zxnfaaz", model.features().clusterResourceId()); - Assertions.assertEquals(false, model.features().disableLocalAuth()); - Assertions.assertEquals("bre", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, model.sku().name()); + Assertions.assertEquals(1036527354, model.sku().capacityReservationLevel()); + Assertions.assertEquals(1960555856, model.retentionInDays()); + Assertions.assertEquals(74.87413920302748D, model.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, model.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, model.publicNetworkAccessForQuery()); + Assertions.assertTrue(model.forceCmkForQuery()); + Assertions.assertTrue(model.features().enableDataExport()); + Assertions.assertTrue(model.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(model.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("tbaxk", model.features().clusterResourceId()); + Assertions.assertFalse(model.features().disableLocalAuth()); + Assertions.assertEquals("jfsmlmbtxhwgfwsr", model.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("coezbrhubskh", model.replication().location()); + Assertions.assertFalse(model.replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java index 723b5faea071..008eb5ecd653 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgeResponseInnerTests.java @@ -12,14 +12,14 @@ public final class WorkspacePurgeResponseInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { WorkspacePurgeResponseInner model - = BinaryData.fromString("{\"operationId\":\"hky\"}").toObject(WorkspacePurgeResponseInner.class); - Assertions.assertEquals("hky", model.operationId()); + = BinaryData.fromString("{\"operationId\":\"y\"}").toObject(WorkspacePurgeResponseInner.class); + Assertions.assertEquals("y", model.operationId()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspacePurgeResponseInner model = new WorkspacePurgeResponseInner().withOperationId("hky"); + WorkspacePurgeResponseInner model = new WorkspacePurgeResponseInner().withOperationId("y"); model = BinaryData.fromObject(model).toObject(WorkspacePurgeResponseInner.class); - Assertions.assertEquals("hky", model.operationId()); + Assertions.assertEquals("y", model.operationId()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java index 3eddddd1f728..288fa7fc2f5e 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacePurgesGetPurgeStatusWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import com.azure.resourcemanager.loganalytics.models.PurgeState; @@ -28,10 +28,10 @@ public void testGetPurgeStatusWithResponse() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); WorkspacePurgeStatusResponse response = manager.workspacePurges() - .getPurgeStatusWithResponse("yrrleaesinuqt", "jqo", "bpihehcecybmrqbr", com.azure.core.util.Context.NONE) + .getPurgeStatusWithResponse("osewxi", "pxvkqma", "pxvpifdfaif", com.azure.core.util.Context.NONE) .getValue(); Assertions.assertEquals(PurgeState.COMPLETED, response.status()); diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceReplicationPropertiesTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceReplicationPropertiesTests.java new file mode 100644 index 000000000000..8c4ef48a1d39 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceReplicationPropertiesTests.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; +import org.junit.jupiter.api.Assertions; + +public final class WorkspaceReplicationPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + WorkspaceReplicationProperties model = BinaryData.fromString( + "{\"location\":\"uaadraufactkahzo\",\"enabled\":true,\"provisioningState\":\"Canceled\",\"createdDate\":\"2021-03-14T01:25:46Z\",\"lastModifiedDate\":\"2021-02-20T11:59:59Z\"}") + .toObject(WorkspaceReplicationProperties.class); + Assertions.assertEquals("uaadraufactkahzo", model.location()); + Assertions.assertTrue(model.enabled()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + WorkspaceReplicationProperties model + = new WorkspaceReplicationProperties().withLocation("uaadraufactkahzo").withEnabled(true); + model = BinaryData.fromObject(model).toObject(WorkspaceReplicationProperties.class); + Assertions.assertEquals("uaadraufactkahzo", model.location()); + Assertions.assertTrue(model.enabled()); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java index 0702c7e26406..6fc300fc797b 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspaceSkuTests.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.loganalytics.generated; import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import org.junit.jupiter.api.Assertions; @@ -13,19 +12,19 @@ public final class WorkspaceSkuTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - WorkspaceSku model = BinaryData - .fromString("{\"name\":\"Standalone\",\"capacityReservationLevel\":5000,\"lastSkuUpdate\":\"sj\"}") + WorkspaceSku model = BinaryData.fromString( + "{\"name\":\"CapacityReservation\",\"capacityReservationLevel\":173772181,\"lastSkuUpdate\":\"2020-12-31T22:39:11Z\"}") .toObject(WorkspaceSku.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO_ZERO, model.capacityReservationLevel()); + Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.name()); + Assertions.assertEquals(173772181, model.capacityReservationLevel()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - WorkspaceSku model = new WorkspaceSku().withName(WorkspaceSkuNameEnum.STANDALONE) - .withCapacityReservationLevel(CapacityReservationLevel.FIVE_ZERO_ZERO_ZERO); + WorkspaceSku model = new WorkspaceSku().withName(WorkspaceSkuNameEnum.CAPACITY_RESERVATION) + .withCapacityReservationLevel(173772181); model = BinaryData.fromObject(model).toObject(WorkspaceSku.class); - Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, model.name()); - Assertions.assertEquals(CapacityReservationLevel.FIVE_ZERO_ZERO_ZERO, model.capacityReservationLevel()); + Assertions.assertEquals(WorkspaceSkuNameEnum.CAPACITY_RESERVATION, model.name()); + Assertions.assertEquals(173772181, model.capacityReservationLevel()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java index be12e3190dd4..b94e3856b518 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesCreateOrUpdateMockTests.java @@ -6,18 +6,21 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.management.serializer.SerializerFactory; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; +import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.Identity; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.UserIdentityProperties; import com.azure.resourcemanager.loganalytics.models.Workspace; import com.azure.resourcemanager.loganalytics.models.WorkspaceCapping; +import com.azure.resourcemanager.loganalytics.models.WorkspaceFailoverProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceFeatures; +import com.azure.resourcemanager.loganalytics.models.WorkspaceReplicationProperties; import com.azure.resourcemanager.loganalytics.models.WorkspaceSku; import com.azure.resourcemanager.loganalytics.models.WorkspaceSkuNameEnum; import java.nio.charset.StandardCharsets; @@ -32,56 +35,65 @@ public final class WorkspacesCreateOrUpdateMockTests { @Test public void testCreateOrUpdate() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"ldtve\",\"sku\":{\"name\":\"Premium\",\"capacityReservationLevel\":100,\"lastSkuUpdate\":\"hzjkn\"},\"retentionInDays\":1633027384,\"workspaceCapping\":{\"dailyQuotaGb\":61.251523393969165,\"quotaNextResetTime\":\"pnrupzaamrdi\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"kidswys\",\"modifiedDate\":\"ruffgllukk\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"vmblcouqe\",\"scopeId\":\"hbcdsziry\"},{\"resourceId\":\"ndo\",\"scopeId\":\"mbltoo\"},{\"resourceId\":\"kfqlwx\",\"scopeId\":\"ykalsyga\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"jksibjg\",\"disableLocalAuth\":true,\"\":{\"pinbmhwbjijkgqxn\":\"dataahmrnadzyqegxyi\",\"znj\":\"datambk\",\"cwkdtaaw\":\"dataujvaannggi\",\"mqkra\":\"datawfekaumrrqmb\"}},\"defaultDataCollectionRuleResourceId\":\"nxwbjsidbirkfp\"},\"identity\":{\"principalId\":\"kd\",\"tenantId\":\"gewi\",\"type\":\"None\",\"userAssignedIdentities\":{\"o\":{\"principalId\":\"bguzozky\",\"clientId\":\"nfnzhhh\"},\"pyc\":{\"principalId\":\"ffjkutycyarnroo\",\"clientId\":\"uabzoghkt\"},\"zptwrlohap\":{\"principalId\":\"coe\",\"clientId\":\"nhzqrottjzcfy\"},\"xpjb\":{\"principalId\":\"nfszpyglqdhmrjz\",\"clientId\":\"l\"}}},\"systemData\":{\"createdBy\":\"sjoqcjenkyhfqzvs\",\"createdByType\":\"Application\",\"createdAt\":\"2021-08-22T03:48:47Z\",\"lastModifiedBy\":\"l\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-04-25T15:23:25Z\"},\"etag\":\"jhhhqxu\",\"location\":\"yvca\",\"tags\":{\"vbsizusjszlbscm\":\"v\"},\"id\":\"lzijiufehgmvflnw\",\"name\":\"v\",\"type\":\"kxrerlniylylyfwx\"}"; + = "{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"edenrexkxbhxv\",\"sku\":{\"name\":\"Standard\",\"capacityReservationLevel\":1049789640,\"lastSkuUpdate\":\"2021-02-13T23:06:36Z\"},\"retentionInDays\":1169492818,\"workspaceCapping\":{\"dailyQuotaGb\":33.579421975520674,\"quotaNextResetTime\":\"znfaj\",\"dataIngestionStatus\":\"ForceOn\"},\"createdDate\":\"2021-06-14T13:50:50Z\",\"modifiedDate\":\"2021-06-29T16:28:10Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"SecuredByPerimeter\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"rl\",\"scopeId\":\"zji\"},{\"resourceId\":\"qfhefkwabsol\",\"scopeId\":\"nqqlmgnl\"},{\"resourceId\":\"sjxtel\",\"scopeId\":\"hvuqbo\"},{\"resourceId\":\"o\",\"scopeId\":\"qocarkuzlbc\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"qytl\",\"disableLocalAuth\":false,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"ckze\",\"nxakckyw\"],\"hfaogzv\":\"datagaabjkdtf\"},\"defaultDataCollectionRuleResourceId\":\"wrsiwdyjqurykc\",\"replication\":{\"location\":\"ueekcsue\",\"enabled\":false,\"provisioningState\":\"Canceled\",\"createdDate\":\"2021-03-11T17:26:18Z\",\"lastModifiedDate\":\"2021-07-31T15:46:45Z\"},\"failover\":{\"state\":\"Deactivating\",\"lastModifiedDate\":\"2021-04-29T13:14:35Z\"}},\"identity\":{\"principalId\":\"d\",\"tenantId\":\"mhmpty\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"fnqt\":{\"principalId\":\"bnrqq\",\"clientId\":\"ztpb\"}}},\"etag\":\"omals\",\"location\":\"bnfddep\",\"tags\":{\"f\":\"qjn\",\"vmywhsbrcarycsjj\":\"ygleexa\",\"dmkrrb\":\"yvoaqajuvehzp\",\"ubefgybpmfbfunu\":\"mpfu\"},\"id\":\"mpzkrvfyifkd\",\"name\":\"chlzvfi\",\"type\":\"tnkjjwgcwnphb\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Workspace response = manager.workspaces() - .define("jxl") - .withRegion("wsdrnpxqwodif") - .withExistingResourceGroup("ecmslclbl") - .withTags(mapOf("wibvjogj", "cjrmmua")) - .withIdentity(new Identity().withType(IdentityType.NONE) - .withUserAssignedIdentities(mapOf("efgwbmqjc", new UserIdentityProperties()))) - .withEtag("jcmmzrrscub") - .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.STANDARD) - .withCapacityReservationLevel(CapacityReservationLevel.TWO_ZERO_ZERO_ZERO)) - .withRetentionInDays(1106041304) - .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(17.1701428900364D)) + .define("gv") + .withRegion("oyfpuq") + .withExistingResourceGroup("yznclkfkee") + .withTags(mapOf("wvpsoz", "ezxlhdjzqdca", "pnx", "iihjriybmrzo")) + .withIdentity(new Identity().withType(IdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf("xomeikjclwzacn", new UserIdentityProperties()))) + .withEtag("fsuqtaazyqbxy") + .withSku(new WorkspaceSku().withName(WorkspaceSkuNameEnum.FREE).withCapacityReservationLevel(965244387)) + .withRetentionInDays(1510649527) + .withWorkspaceCapping(new WorkspaceCapping().withDailyQuotaGb(15.022557422512794D)) .withPublicNetworkAccessForIngestion(PublicNetworkAccessType.ENABLED) - .withPublicNetworkAccessForQuery(PublicNetworkAccessType.ENABLED) - .withForceCmkForQuery(false) + .withPublicNetworkAccessForQuery(PublicNetworkAccessType.SECURED_BY_PERIMETER) + .withForceCmkForQuery(true) .withFeatures(new WorkspaceFeatures().withEnableDataExport(true) - .withImmediatePurgeDataOn30Days(true) - .withEnableLogAccessUsingOnlyResourcePermissions(false) - .withClusterResourceId("d") - .withDisableLocalAuth(true) - .withAdditionalProperties(mapOf())) - .withDefaultDataCollectionRuleResourceId("ulrtywikdmh") + .withImmediatePurgeDataOn30Days(false) + .withEnableLogAccessUsingOnlyResourcePermissions(true) + .withClusterResourceId("llqxbdmvrscm") + .withDisableLocalAuth(false) + .withAdditionalProperties(mapOf("associations", + SerializerFactory.createDefaultManagementSerializerAdapter() + .deserialize("[\"nyeofltfnnxrk\",\"dj\",\"ynnfmuiii\",\"ipfohykfkx\"]", Object.class, + SerializerEncoding.JSON), + "ewoi", "databrwjiutgnjizb", "uifr", "datad", "pezkis", "datavka", "unifiedSentinelBillingOnly", + true, "juyrsrziuctixg", "datamrvz"))) + .withDefaultDataCollectionRuleResourceId("jm") + .withReplication(new WorkspaceReplicationProperties().withLocation("syparybjufp").withEnabled(true)) + .withFailover(new WorkspaceFailoverProperties()) .create(); - Assertions.assertEquals("yvca", response.location()); - Assertions.assertEquals("v", response.tags().get("vbsizusjszlbscm")); - Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("jhhhqxu", response.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.PREMIUM, response.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO, response.sku().capacityReservationLevel()); - Assertions.assertEquals(1633027384, response.retentionInDays()); - Assertions.assertEquals(61.251523393969165D, response.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.publicNetworkAccessForQuery()); - Assertions.assertEquals(false, response.forceCmkForQuery()); - Assertions.assertEquals(true, response.features().enableDataExport()); - Assertions.assertEquals(true, response.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(false, response.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("jksibjg", response.features().clusterResourceId()); - Assertions.assertEquals(true, response.features().disableLocalAuth()); - Assertions.assertEquals("nxwbjsidbirkfp", response.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("bnfddep", response.location()); + Assertions.assertEquals("qjn", response.tags().get("f")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.identity().type()); + Assertions.assertEquals("omals", response.etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.STANDARD, response.sku().name()); + Assertions.assertEquals(1049789640, response.sku().capacityReservationLevel()); + Assertions.assertEquals(1169492818, response.retentionInDays()); + Assertions.assertEquals(33.579421975520674D, response.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, + response.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, response.publicNetworkAccessForQuery()); + Assertions.assertFalse(response.forceCmkForQuery()); + Assertions.assertFalse(response.features().enableDataExport()); + Assertions.assertFalse(response.features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(response.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("qytl", response.features().clusterResourceId()); + Assertions.assertFalse(response.features().disableLocalAuth()); + Assertions.assertEquals("wrsiwdyjqurykc", response.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("ueekcsue", response.replication().location()); + Assertions.assertFalse(response.replication().enabled()); } // Use "Map.of" if available diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java index 4025d2a3e4b9..3fd769770841 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesDeleteMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDelete() throws Exception { LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.workspaces().delete("odlfpyapucygvo", "vyuns", true, com.azure.core.util.Context.NONE); + manager.workspaces().delete("xmbjroum", "znv", false, com.azure.core.util.Context.NONE); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java index 708ef7ba7672..043403b84e0a 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetByResourceGroupWithResponseMockTests.java @@ -6,11 +6,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -25,35 +24,38 @@ public final class WorkspacesGetByResourceGroupWithResponseMockTests { @Test public void testGetByResourceGroupWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"uygdhgaqipirp\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":1000,\"lastSkuUpdate\":\"ulopmjnlexwhcb\"},\"retentionInDays\":1491693299,\"workspaceCapping\":{\"dailyQuotaGb\":3.5229410575627673,\"quotaNextResetTime\":\"uuuercta\",\"dataIngestionStatus\":\"RespectQuota\"},\"createdDate\":\"ntqpbr\",\"modifiedDate\":\"yrduczkgofxyfsr\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Enabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"tbstvjeaqnrmv\",\"scopeId\":\"koxmlghk\"},{\"resourceId\":\"idvrmaz\",\"scopeId\":\"dwwexymz\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"wvqsgny\",\"disableLocalAuth\":true,\"\":{\"yyvpkpatlb\":\"datavensrpm\",\"gsksrfhf\":\"datajp\",\"bnxwc\":\"dataolmk\",\"fgbrtt\":\"dataommpvfqaw\"}},\"defaultDataCollectionRuleResourceId\":\"aclkiexhajlfnt\"},\"identity\":{\"principalId\":\"fyut\",\"tenantId\":\"iygbpvn\",\"type\":\"None\",\"userAssignedIdentities\":{\"fg\":{\"principalId\":\"xkyctwwgzwx\",\"clientId\":\"mecvogygzyvneeza\"}}},\"systemData\":{\"createdBy\":\"oqqtl\",\"createdByType\":\"Application\",\"createdAt\":\"2020-12-26T15:29:31Z\",\"lastModifiedBy\":\"rkjjjavfqnvhnq\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-01-06T07:59:03Z\"},\"etag\":\"iyet\",\"location\":\"sypvidbztjhqtfb\",\"tags\":{\"p\":\"ynkbwetnju\",\"piaccxnafb\":\"prkzya\"},\"id\":\"qroohtu\",\"name\":\"vmaonurjt\",\"type\":\"mghihp\"}"; + = "{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"bpdbollgr\",\"sku\":{\"name\":\"Standalone\",\"capacityReservationLevel\":1441651500,\"lastSkuUpdate\":\"2021-01-18T17:52:58Z\"},\"retentionInDays\":693005184,\"workspaceCapping\":{\"dailyQuotaGb\":85.75670564450144,\"quotaNextResetTime\":\"nequy\",\"dataIngestionStatus\":\"OverQuota\"},\"createdDate\":\"2021-03-14T09:15:47Z\",\"modifiedDate\":\"2021-08-01T19:22:02Z\",\"publicNetworkAccessForIngestion\":\"SecuredByPerimeter\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"adrmmwiuawvcmjzk\",\"scopeId\":\"idisczskosw\"},{\"resourceId\":\"iqazugamxzkr\",\"scopeId\":\"oiisbamnppcce\"},{\"resourceId\":\"ztdsbeza\",\"scopeId\":\"f\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"hnepkpeti\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":true,\"associations\":[\"xdukecpxd\",\"zvdhctmmkosz\",\"dblnsntrp\",\"aqkiofkb\"],\"ezyquw\":\"datahklbnldpvcbh\",\"brruyuuatv\":\"datasqxutr\"},\"defaultDataCollectionRuleResourceId\":\"bjwcolbmx\",\"replication\":{\"location\":\"w\",\"enabled\":true,\"provisioningState\":\"EnableRequested\",\"createdDate\":\"2020-12-20T15:37:07Z\",\"lastModifiedDate\":\"2021-02-13T22:53:47Z\"},\"failover\":{\"state\":\"Activating\",\"lastModifiedDate\":\"2021-01-25T19:22:53Z\"}},\"identity\":{\"principalId\":\"hocn\",\"tenantId\":\"cmj\",\"type\":\"None\",\"userAssignedIdentities\":{\"tjfdoesxxhmw\":{\"principalId\":\"oqrxtdisnjevhdlm\",\"clientId\":\"idwhepfw\"},\"t\":{\"principalId\":\"bckyoikxk\",\"clientId\":\"negknjzrb\"},\"hjhgem\":{\"principalId\":\"plvukaobrlbpg\",\"clientId\":\"bagn\"}}},\"etag\":\"akywalhjymxcgqta\",\"location\":\"drclssoljome\",\"tags\":{\"gjiiytssiki\":\"ycnlbvgjcodk\",\"gmqsorhcekxg\":\"bcufqbvntn\"},\"id\":\"lykmxcpwzvmdo\",\"name\":\"sqdtiwlwxlbon\",\"type\":\"qba\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); Workspace response = manager.workspaces() - .getByResourceGroupWithResponse("lghieegjlgvvpase", "sgb", com.azure.core.util.Context.NONE) + .getByResourceGroupWithResponse("qjrhuzgfxonj", "pusllywpv", com.azure.core.util.Context.NONE) .getValue(); - Assertions.assertEquals("sypvidbztjhqtfb", response.location()); - Assertions.assertEquals("ynkbwetnju", response.tags().get("p")); + Assertions.assertEquals("drclssoljome", response.location()); + Assertions.assertEquals("ycnlbvgjcodk", response.tags().get("gjiiytssiki")); Assertions.assertEquals(IdentityType.NONE, response.identity().type()); - Assertions.assertEquals("iyet", response.etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.sku().name()); - Assertions.assertEquals(CapacityReservationLevel.ONE_ZERO_ZERO_ZERO, response.sku().capacityReservationLevel()); - Assertions.assertEquals(1491693299, response.retentionInDays()); - Assertions.assertEquals(3.5229410575627673D, response.workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.publicNetworkAccessForIngestion()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, response.publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.forceCmkForQuery()); - Assertions.assertEquals(false, response.features().enableDataExport()); - Assertions.assertEquals(false, response.features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, response.features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("wvqsgny", response.features().clusterResourceId()); - Assertions.assertEquals(true, response.features().disableLocalAuth()); - Assertions.assertEquals("aclkiexhajlfnt", response.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("akywalhjymxcgqta", response.etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.STANDALONE, response.sku().name()); + Assertions.assertEquals(1441651500, response.sku().capacityReservationLevel()); + Assertions.assertEquals(693005184, response.retentionInDays()); + Assertions.assertEquals(85.75670564450144D, response.workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, + response.publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.publicNetworkAccessForQuery()); + Assertions.assertTrue(response.forceCmkForQuery()); + Assertions.assertTrue(response.features().enableDataExport()); + Assertions.assertFalse(response.features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(response.features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("hnepkpeti", response.features().clusterResourceId()); + Assertions.assertTrue(response.features().disableLocalAuth()); + Assertions.assertEquals("bjwcolbmx", response.defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("w", response.replication().location()); + Assertions.assertTrue(response.replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspWithResponseMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspWithResponseMockTests.java new file mode 100644 index 000000000000..cfd8d9d65886 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesGetNspWithResponseMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.loganalytics.LogAnalyticsManager; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfiguration; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspacesGetNspWithResponseMockTests { + @Test + public void testGetNspWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"provisioningState\":\"Canceled\",\"provisioningIssues\":[{\"name\":\"qkaye\",\"properties\":{\"issueType\":\"MissingPerimeterConfiguration\",\"severity\":\"Error\",\"description\":\"lwfgziiu\",\"suggestedResourceIds\":[\"jceatlijjjrtva\",\"caszk\",\"xk\"],\"suggestedAccessRules\":[{},{},{},{}]}},{\"name\":\"etyvkunmignohi\",\"properties\":{\"issueType\":\"Unknown\",\"severity\":\"Warning\",\"description\":\"wpin\",\"suggestedResourceIds\":[\"vabbx\",\"hmedeilbjywfcfxz\",\"rzzihvwypus\",\"vjslczwcii\"],\"suggestedAccessRules\":[{},{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"fryvdmvxadqac\",\"perimeterGuid\":\"9bde5da3-3ba4-4215-8b61-6e214c73bc9f\",\"location\":\"naw\"},\"resourceAssociation\":{\"name\":\"gfbktyjmf\",\"accessMode\":\"Learning\"},\"profile\":{\"name\":\"yq\",\"accessRulesVersion\":988633110,\"accessRules\":[{\"name\":\"owoxqmj\",\"properties\":{}},{\"name\":\"cxn\",\"properties\":{}}],\"diagnosticSettingsVersion\":473965533,\"enabledLogCategories\":[\"usrvx\",\"simjceagbjqvlsu\"]}},\"id\":\"wzas\",\"name\":\"xgo\",\"type\":\"oyjfqipu\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + LogAnalyticsManager manager = LogAnalyticsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + NetworkSecurityPerimeterConfiguration response = manager.workspaces() + .getNspWithResponse("grpxncakiqaondjr", "clamgglvlmfejdoq", "ykglt", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("fryvdmvxadqac", response.properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("9bde5da3-3ba4-4215-8b61-6e214c73bc9f"), + response.properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("naw", response.properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("gfbktyjmf", response.properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.LEARNING, + response.properties().resourceAssociation().accessMode()); + Assertions.assertEquals("yq", response.properties().profile().name()); + Assertions.assertEquals(988633110, response.properties().profile().accessRulesVersion()); + Assertions.assertEquals("owoxqmj", response.properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(473965533, response.properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("usrvx", response.properties().profile().enabledLogCategories().get(0)); + } +} diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java index a770ad13174e..e3375af4e2b8 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListByResourceGroupMockTests.java @@ -7,11 +7,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -26,38 +25,38 @@ public final class WorkspacesListByResourceGroupMockTests { @Test public void testListByResourceGroup() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Failed\",\"customerId\":\"rxvbfihwuh\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":200,\"lastSkuUpdate\":\"rbxrblmliowxihsp\"},\"retentionInDays\":510914114,\"workspaceCapping\":{\"dailyQuotaGb\":25.078160367574576,\"quotaNextResetTime\":\"pzwaklsbsbqqq\",\"dataIngestionStatus\":\"SubscriptionSuspended\"},\"createdDate\":\"rxaomzisglrrcze\",\"modifiedDate\":\"hhltnjadhqo\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"fbpcmsplb\",\"scopeId\":\"rueqthwm\"},{\"resourceId\":\"mbscbbx\",\"scopeId\":\"dhxiidlopedbwd\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"md\",\"disableLocalAuth\":true,\"\":{\"qacigeleo\":\"dataqwremjel\",\"vqvwzkjopwbe\":\"datad\",\"x\":\"datanrlkwzdqy\"}},\"defaultDataCollectionRuleResourceId\":\"akxcptsoqfyiaseq\"},\"identity\":{\"principalId\":\"rttzrazisgykiu\",\"tenantId\":\"vanbwzohmnrxxbs\",\"type\":\"user\",\"userAssignedIdentities\":{\"g\":{\"principalId\":\"nhmdptysprqs\",\"clientId\":\"zxojpslsv\"},\"q\":{\"principalId\":\"iufiqwo\",\"clientId\":\"qvapcohhoucq\"},\"ddtjwfljhznam\":{\"principalId\":\"xcxzrzdcgdzben\",\"clientId\":\"bcawetz\"},\"vgbgatzuuvbxng\":{\"principalId\":\"atmzw\",\"clientId\":\"jncqtjzmi\"}}},\"systemData\":{\"createdBy\":\"wggahttzlswvaj\",\"createdByType\":\"Key\",\"createdAt\":\"2021-09-26T07:25:25Z\",\"lastModifiedBy\":\"joqza\",\"lastModifiedByType\":\"ManagedIdentity\",\"lastModifiedAt\":\"2021-02-03T05:21:58Z\"},\"etag\":\"j\",\"location\":\"frgqhaohcm\",\"tags\":{\"l\":\"cnjrohmbpyryxame\"},\"id\":\"dyvkfkmr\",\"name\":\"cxneh\",\"type\":\"sm\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Succeeded\",\"customerId\":\"vezcrcssbzhdd\",\"sku\":{\"name\":\"PerNode\",\"capacityReservationLevel\":1056555607,\"lastSkuUpdate\":\"2021-11-16T04:37:45Z\"},\"retentionInDays\":106775575,\"workspaceCapping\":{\"dailyQuotaGb\":55.74174962524516,\"quotaNextResetTime\":\"pavawugiqjtio\",\"dataIngestionStatus\":\"ForceOff\"},\"createdDate\":\"2021-09-30T21:30:49Z\",\"modifiedDate\":\"2021-08-09T13:44:28Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"iygspnbonhpczyk\",\"scopeId\":\"tp\"},{\"resourceId\":\"xqcsehch\",\"scopeId\":\"ufmpqumqyjgy\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":false,\"clusterResourceId\":\"uzanhsfnhsenwphp\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":false,\"associations\":[\"lidftujwjj\"],\"ssruqnmdvhazcvj\":\"databeqrkuorh\",\"wbqerzwxiytxtd\":\"datatiq\",\"ktg\":\"dataukvlb\"},\"defaultDataCollectionRuleResourceId\":\"tyouambewreswmow\",\"replication\":{\"location\":\"mut\",\"enabled\":false,\"provisioningState\":\"DisableRequested\",\"createdDate\":\"2021-05-23T20:36:12Z\",\"lastModifiedDate\":\"2021-05-17T10:49:14Z\"},\"failover\":{\"state\":\"Activating\",\"lastModifiedDate\":\"2021-06-23T04:35:50Z\"}},\"identity\":{\"principalId\":\"spxlzde\",\"tenantId\":\"grijwaiufanrayb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ygzmxieqvdsmak\":{\"principalId\":\"rojsydg\",\"clientId\":\"ydkygywezskieca\"},\"ybxawoijpodtblx\":{\"principalId\":\"xq\",\"clientId\":\"hyhxa\"},\"emehllizh\":{\"principalId\":\"kwjdjodqhy\",\"clientId\":\"ncn\"},\"dtluvvadswzsn\":{\"principalId\":\"umoqodkad\",\"clientId\":\"yibngqladywrxwh\"}}},\"etag\":\"mlowuowhl\",\"location\":\"lnwy\",\"tags\":{\"okzkltr\":\"uvblg\",\"rqcrjidhftukvh\":\"owtdvrfmvlihcvj\"},\"id\":\"xlwyoj\",\"name\":\"fqz\",\"type\":\"kfnjyixhafrat\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response - = manager.workspaces().listByResourceGroup("qltgrd", com.azure.core.util.Context.NONE); + = manager.workspaces().listByResourceGroup("dbpb", com.azure.core.util.Context.NONE); - Assertions.assertEquals("frgqhaohcm", response.iterator().next().location()); - Assertions.assertEquals("cnjrohmbpyryxame", response.iterator().next().tags().get("l")); - Assertions.assertEquals(IdentityType.USER, response.iterator().next().identity().type()); - Assertions.assertEquals("j", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.TWO_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(510914114, response.iterator().next().retentionInDays()); - Assertions.assertEquals(25.078160367574576D, response.iterator().next().workspaceCapping().dailyQuotaGb()); + Assertions.assertEquals("lnwy", response.iterator().next().location()); + Assertions.assertEquals("uvblg", response.iterator().next().tags().get("okzkltr")); + Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); + Assertions.assertEquals("mlowuowhl", response.iterator().next().etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.PER_NODE, response.iterator().next().sku().name()); + Assertions.assertEquals(1056555607, response.iterator().next().sku().capacityReservationLevel()); + Assertions.assertEquals(106775575, response.iterator().next().retentionInDays()); + Assertions.assertEquals(55.74174962524516D, response.iterator().next().workspaceCapping().dailyQuotaGb()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.iterator().next().publicNetworkAccessForIngestion()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(true, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(false, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("md", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(true, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("akxcptsoqfyiaseq", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertFalse(response.iterator().next().forceCmkForQuery()); + Assertions.assertFalse(response.iterator().next().features().enableDataExport()); + Assertions.assertTrue(response.iterator().next().features().immediatePurgeDataOn30Days()); + Assertions.assertFalse(response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("uzanhsfnhsenwphp", response.iterator().next().features().clusterResourceId()); + Assertions.assertTrue(response.iterator().next().features().disableLocalAuth()); + Assertions.assertEquals("tyouambewreswmow", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("mut", response.iterator().next().replication().location()); + Assertions.assertFalse(response.iterator().next().replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java index f829a0836d61..dd45f0116751 100644 --- a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListMockTests.java @@ -7,11 +7,10 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.loganalytics.LogAnalyticsManager; -import com.azure.resourcemanager.loganalytics.models.CapacityReservationLevel; import com.azure.resourcemanager.loganalytics.models.IdentityType; import com.azure.resourcemanager.loganalytics.models.PublicNetworkAccessType; import com.azure.resourcemanager.loganalytics.models.Workspace; @@ -26,37 +25,37 @@ public final class WorkspacesListMockTests { @Test public void testList() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"provisioningState\":\"Deleting\",\"customerId\":\"wdtgukranblw\",\"sku\":{\"name\":\"LACluster\",\"capacityReservationLevel\":400,\"lastSkuUpdate\":\"c\"},\"retentionInDays\":1802278503,\"workspaceCapping\":{\"dailyQuotaGb\":33.5739290982965,\"quotaNextResetTime\":\"hoi\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"niiprglvaw\",\"modifiedDate\":\"z\",\"publicNetworkAccessForIngestion\":\"Enabled\",\"publicNetworkAccessForQuery\":\"Disabled\",\"forceCmkForQuery\":true,\"privateLinkScopedResources\":[{\"resourceId\":\"bjpmcubk\",\"scopeId\":\"foxx\"},{\"resourceId\":\"bvphavpm\",\"scopeId\":\"rbqgvgov\"}],\"features\":{\"enableDataExport\":true,\"immediatePurgeDataOn30Days\":false,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"knssqyzqed\",\"disableLocalAuth\":false,\"\":{\"qmrjg\":\"datadb\",\"mjpb\":\"dataihfqlggwfiwzc\",\"pgxh\":\"dataephmgtvljvrcmyfq\"}},\"defaultDataCollectionRuleResourceId\":\"omyqwcabvnuileey\"},\"identity\":{\"principalId\":\"lpaugmrm\",\"tenantId\":\"lrxw\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"psmgo\":{\"principalId\":\"hfkvcisizmoaedsx\",\"clientId\":\"uivedwcgyeewxeiq\"},\"gaufcs\":{\"principalId\":\"u\",\"clientId\":\"ljdlrgmspl\"}}},\"systemData\":{\"createdBy\":\"new\",\"createdByType\":\"User\",\"createdAt\":\"2021-05-21T08:44:22Z\",\"lastModifiedBy\":\"pqanxrjkix\",\"lastModifiedByType\":\"User\",\"lastModifiedAt\":\"2021-11-28T23:05:19Z\"},\"etag\":\"ypnyghshxc\",\"location\":\"lhkgmnsghp\",\"tags\":{\"jkhvyomacluzvxnq\":\"phdrw\",\"df\":\"hrpq\",\"xuifmcsypobkdqz\":\"mkoisqcssf\",\"dmxzjijpv\":\"dzsylollgtrczz\"},\"id\":\"aurkihcirlde\",\"name\":\"xrdcoxnbkkja\",\"type\":\"urnnqbnqbpiz\"}]}"; + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"customerId\":\"uubeid\",\"sku\":{\"name\":\"Free\",\"capacityReservationLevel\":932346466,\"lastSkuUpdate\":\"2021-08-27T04:01:07Z\"},\"retentionInDays\":1084613444,\"workspaceCapping\":{\"dailyQuotaGb\":83.86160418016159,\"quotaNextResetTime\":\"fltgvdiho\",\"dataIngestionStatus\":\"ApproachingQuota\"},\"createdDate\":\"2021-07-12T20:14:31Z\",\"modifiedDate\":\"2021-07-25T19:58:40Z\",\"publicNetworkAccessForIngestion\":\"Disabled\",\"publicNetworkAccessForQuery\":\"SecuredByPerimeter\",\"forceCmkForQuery\":false,\"privateLinkScopedResources\":[{\"resourceId\":\"cpcunnuzdqum\",\"scopeId\":\"nod\"},{\"resourceId\":\"ienhqhskndnelq\",\"scopeId\":\"adlknwfoanni\"},{\"resourceId\":\"petxivcnrlyxnu\",\"scopeId\":\"ephblkwqpatvbqs\"}],\"features\":{\"enableDataExport\":false,\"immediatePurgeDataOn30Days\":true,\"enableLogAccessUsingOnlyResourcePermissions\":true,\"clusterResourceId\":\"vuzqymt\",\"disableLocalAuth\":true,\"unifiedSentinelBillingOnly\":true,\"associations\":[\"it\",\"qhzvb\"],\"cxmxeatkdb\":\"datadbanfznd\"},\"defaultDataCollectionRuleResourceId\":\"nrd\",\"replication\":{\"location\":\"bqbnaomhjrmkuh\",\"enabled\":true,\"provisioningState\":\"DisableRequested\",\"createdDate\":\"2021-08-22T07:08:52Z\",\"lastModifiedDate\":\"2021-07-09T10:57:05Z\"},\"failover\":{\"state\":\"Deactivating\",\"lastModifiedDate\":\"2021-03-26T01:09:54Z\"}},\"identity\":{\"principalId\":\"anc\",\"tenantId\":\"xxqcwgaxf\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"zyyfy\":{\"principalId\":\"okzwjjzrlt\",\"clientId\":\"l\"},\"ujivyqlkjuvsm\":{\"principalId\":\"qsix\",\"clientId\":\"m\"}}},\"etag\":\"lzoy\",\"location\":\"vwzdbpqvyb\",\"tags\":{\"okcvtlubses\":\"vmx\",\"pirykycndzfqiv\":\"vcuartrhun\"},\"id\":\"reuykbbmnwagl\",\"name\":\"bxoeeonql\",\"type\":\"fwmyymv\"}]}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); LogAnalyticsManager manager = LogAnalyticsManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); PagedIterable response = manager.workspaces().list(com.azure.core.util.Context.NONE); - Assertions.assertEquals("lhkgmnsghp", response.iterator().next().location()); - Assertions.assertEquals("phdrw", response.iterator().next().tags().get("jkhvyomacluzvxnq")); + Assertions.assertEquals("vwzdbpqvyb", response.iterator().next().location()); + Assertions.assertEquals("vmx", response.iterator().next().tags().get("okcvtlubses")); Assertions.assertEquals(IdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("ypnyghshxc", response.iterator().next().etag()); - Assertions.assertEquals(WorkspaceSkuNameEnum.LACLUSTER, response.iterator().next().sku().name()); - Assertions.assertEquals(CapacityReservationLevel.FOUR_ZERO_ZERO, - response.iterator().next().sku().capacityReservationLevel()); - Assertions.assertEquals(1802278503, response.iterator().next().retentionInDays()); - Assertions.assertEquals(33.5739290982965D, response.iterator().next().workspaceCapping().dailyQuotaGb()); - Assertions.assertEquals(PublicNetworkAccessType.ENABLED, - response.iterator().next().publicNetworkAccessForIngestion()); + Assertions.assertEquals("lzoy", response.iterator().next().etag()); + Assertions.assertEquals(WorkspaceSkuNameEnum.FREE, response.iterator().next().sku().name()); + Assertions.assertEquals(932346466, response.iterator().next().sku().capacityReservationLevel()); + Assertions.assertEquals(1084613444, response.iterator().next().retentionInDays()); + Assertions.assertEquals(83.86160418016159D, response.iterator().next().workspaceCapping().dailyQuotaGb()); Assertions.assertEquals(PublicNetworkAccessType.DISABLED, + response.iterator().next().publicNetworkAccessForIngestion()); + Assertions.assertEquals(PublicNetworkAccessType.SECURED_BY_PERIMETER, response.iterator().next().publicNetworkAccessForQuery()); - Assertions.assertEquals(true, response.iterator().next().forceCmkForQuery()); - Assertions.assertEquals(true, response.iterator().next().features().enableDataExport()); - Assertions.assertEquals(false, response.iterator().next().features().immediatePurgeDataOn30Days()); - Assertions.assertEquals(true, - response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); - Assertions.assertEquals("knssqyzqed", response.iterator().next().features().clusterResourceId()); - Assertions.assertEquals(false, response.iterator().next().features().disableLocalAuth()); - Assertions.assertEquals("omyqwcabvnuileey", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertFalse(response.iterator().next().forceCmkForQuery()); + Assertions.assertFalse(response.iterator().next().features().enableDataExport()); + Assertions.assertTrue(response.iterator().next().features().immediatePurgeDataOn30Days()); + Assertions.assertTrue(response.iterator().next().features().enableLogAccessUsingOnlyResourcePermissions()); + Assertions.assertEquals("vuzqymt", response.iterator().next().features().clusterResourceId()); + Assertions.assertTrue(response.iterator().next().features().disableLocalAuth()); + Assertions.assertEquals("nrd", response.iterator().next().defaultDataCollectionRuleResourceId()); + Assertions.assertEquals("bqbnaomhjrmkuh", response.iterator().next().replication().location()); + Assertions.assertTrue(response.iterator().next().replication().enabled()); } } diff --git a/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspMockTests.java b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspMockTests.java new file mode 100644 index 000000000000..f7ef055fa986 --- /dev/null +++ b/sdk/loganalytics/azure-resourcemanager-loganalytics/src/test/java/com/azure/resourcemanager/loganalytics/generated/WorkspacesListNspMockTests.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.loganalytics.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.loganalytics.LogAnalyticsManager; +import com.azure.resourcemanager.loganalytics.models.NetworkSecurityPerimeterConfiguration; +import com.azure.resourcemanager.loganalytics.models.ResourceAssociationAccessMode; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class WorkspacesListNspMockTests { + @Test + public void testListNsp() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"provisioningState\":\"Updating\",\"provisioningIssues\":[{\"name\":\"kxyqvgxiaodetv\",\"properties\":{\"issueType\":\"MissingPerimeterConfiguration\",\"severity\":\"Warning\",\"description\":\"wsaifmcwno\",\"suggestedResourceIds\":[\"lehgcvkbc\",\"njolgjyyxpv\",\"lszerqzevx\",\"qe\"],\"suggestedAccessRules\":[{},{},{}]}},{\"name\":\"waljglzoblqwaaf\",\"properties\":{\"issueType\":\"Unknown\",\"severity\":\"Warning\",\"description\":\"yqbhd\",\"suggestedResourceIds\":[\"jrqpjiyrqjcrga\",\"wmzwdfkbnrzorpdl\",\"bqc\"],\"suggestedAccessRules\":[{},{},{}]}}],\"networkSecurityPerimeter\":{\"id\":\"xxsaetgz\",\"perimeterGuid\":\"356dc794-27de-474a-b01f-8e647225fb47\",\"location\":\"pyigdaqqilzdc\"},\"resourceAssociation\":{\"name\":\"joedx\",\"accessMode\":\"Enforced\"},\"profile\":{\"name\":\"i\",\"accessRulesVersion\":652197370,\"accessRules\":[{\"name\":\"wgilfjqqac\",\"properties\":{}},{\"name\":\"xwxdcvjwc\",\"properties\":{}}],\"diagnosticSettingsVersion\":148579488,\"enabledLogCategories\":[\"ciqchxrtuicd\",\"iw\"]}},\"id\":\"m\",\"name\":\"p\",\"type\":\"hzzwvywrgyngy\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + LogAnalyticsManager manager = LogAnalyticsManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.workspaces().listNsp("qicqchygt", "xbyja", com.azure.core.util.Context.NONE); + + Assertions.assertEquals("xxsaetgz", response.iterator().next().properties().networkSecurityPerimeter().id()); + Assertions.assertEquals(UUID.fromString("356dc794-27de-474a-b01f-8e647225fb47"), + response.iterator().next().properties().networkSecurityPerimeter().perimeterGuid()); + Assertions.assertEquals("pyigdaqqilzdc", + response.iterator().next().properties().networkSecurityPerimeter().location()); + Assertions.assertEquals("joedx", response.iterator().next().properties().resourceAssociation().name()); + Assertions.assertEquals(ResourceAssociationAccessMode.ENFORCED, + response.iterator().next().properties().resourceAssociation().accessMode()); + Assertions.assertEquals("i", response.iterator().next().properties().profile().name()); + Assertions.assertEquals(652197370, response.iterator().next().properties().profile().accessRulesVersion()); + Assertions.assertEquals("wgilfjqqac", + response.iterator().next().properties().profile().accessRules().get(0).name()); + Assertions.assertEquals(148579488, + response.iterator().next().properties().profile().diagnosticSettingsVersion()); + Assertions.assertEquals("ciqchxrtuicd", + response.iterator().next().properties().profile().enabledLogCategories().get(0)); + } +} diff --git a/sdk/openai/azure-ai-openai-realtime/pom.xml b/sdk/openai/azure-ai-openai-realtime/pom.xml index ca7910bc3405..f3d76274d452 100644 --- a/sdk/openai/azure-ai-openai-realtime/pom.xml +++ b/sdk/openai/azure-ai-openai-realtime/pom.xml @@ -66,7 +66,7 @@ io.netty netty-codec-http - 4.1.127.Final + 4.1.130.Final @@ -102,7 +102,7 @@ - io.netty:netty-codec-http:[4.1.127.Final] + io.netty:netty-codec-http:[4.1.130.Final] diff --git a/sdk/openai/azure-ai-openai-stainless/pom.xml b/sdk/openai/azure-ai-openai-stainless/pom.xml index c5ef78dc4142..45eb20131aab 100644 --- a/sdk/openai/azure-ai-openai-stainless/pom.xml +++ b/sdk/openai/azure-ai-openai-stainless/pom.xml @@ -57,7 +57,7 @@ com.openai openai-java - 4.6.1 + 4.14.0 @@ -132,7 +132,7 @@ - com.openai:openai-java:[4.6.1] + com.openai:openai-java:[4.14.0] diff --git a/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md b/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md index f536203cffd7..4d2c7437ec33 100644 --- a/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md +++ b/sdk/redis/azure-resourcemanager-redis/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Supported enabling/disabling authentication through access keys for `RedisCache`. + ### Breaking Changes ### Bugs Fixed diff --git a/sdk/redis/azure-resourcemanager-redis/assets.json b/sdk/redis/azure-resourcemanager-redis/assets.json index ff91e635fa8b..d626082c69e9 100644 --- a/sdk/redis/azure-resourcemanager-redis/assets.json +++ b/sdk/redis/azure-resourcemanager-redis/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "java", "TagPrefix": "java/redis/azure-resourcemanager-redis", - "Tag": "java/redis/azure-resourcemanager-redis_87b73bc96e" + "Tag": "java/redis/azure-resourcemanager-redis_4829c91ebd" } diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisCacheImpl.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisCacheImpl.java index 5fcbb1f737a9..f735066bef05 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisCacheImpl.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/implementation/RedisCacheImpl.java @@ -380,6 +380,11 @@ public RedisCacheImpl withStaticIp(String staticIp) { return this; } + @Override + public boolean isAccessKeyAuthenticationEnabled() { + return !ResourceManagerUtils.toPrimitiveBoolean(this.innerModel().disableAccessKeyAuthentication()); + } + @Override public RedisCacheImpl withBasicSku() { if (isInCreateMode()) { @@ -742,6 +747,26 @@ public RedisCacheImpl disablePublicNetworkAccess() { return this; } + @Override + public RedisCacheImpl disableAccessKeyAuthentication() { + if (isInCreateMode()) { + createParameters.withDisableAccessKeyAuthentication(true); + } else { + updateParameters.withDisableAccessKeyAuthentication(true); + } + return this; + } + + @Override + public RedisCacheImpl enableAccessKeyAuthentication() { + if (isInCreateMode()) { + createParameters.withDisableAccessKeyAuthentication(false); + } else { + updateParameters.withDisableAccessKeyAuthentication(false); + } + return this; + } + private static final class PrivateLinkResourceImpl implements PrivateLinkResource { private final PrivateLinkResourceInner innerModel; diff --git a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCache.java b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCache.java index e521588c5ea9..2683f80aa9ec 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCache.java +++ b/sdk/redis/azure-resourcemanager-redis/src/main/java/com/azure/resourcemanager/redis/models/RedisCache.java @@ -181,6 +181,15 @@ public interface RedisCache extends GroupableResource { interface WithGroup extends GroupableResource.DefinitionStages.WithGroup { } + /** + * The stage of Redis cache definition allowing to toggle authentication through access keys. + */ + interface WithAccessKeyAuthentication { + /** + * Specifies that authentication to Redis through access keys is disabled. + * + * @return next stage of the Redis cache definition + */ + default WithCreate disableAccessKeyAuthentication() { + throw new UnsupportedOperationException( + "[disableAccessKeyAuthentication] is not supported in " + getClass()); + } + } + /** A Redis Cache definition allowing the sku to be set. */ interface WithSku { /** @@ -250,7 +274,8 @@ interface WithSku { * A Redis Cache definition with sufficient inputs to create a new Redis Cache in the cloud, but exposing * additional optional inputs to specify. */ - interface WithCreate extends Creatable, DefinitionWithTags { + interface WithCreate extends Creatable, DefinitionWithTags, + DefinitionStages.WithAccessKeyAuthentication { /** * Enables non-ssl Redis server port (6379). * @@ -408,6 +433,32 @@ interface WithPremiumSkuCreate extends DefinitionStages.WithCreate { /** Grouping of all the Redis Cache update stages. */ interface UpdateStages { + + /** + * The stage of Redis cache update allowing to toggle authentication through access keys. + */ + interface WithAccessKeyAuthentication { + /** + * Specifies that authentication to Redis through access keys is disabled. + * + * @return next stage of the Redis cache update + */ + default Update disableAccessKeyAuthentication() { + throw new UnsupportedOperationException( + "[disableAccessKeyAuthentication] is not supported in " + getClass()); + } + + /** + * Specifies that authentication to Redis through access keys is enabled. + * + * @return next stage of the Redis cache update + */ + default Update enableAccessKeyAuthentication() { + throw new UnsupportedOperationException( + "[enableAccessKeyAuthentication] is not supported in " + getClass()); + } + } + /** A Redis Cache update stage allowing to change the parameters. */ interface WithSku { @@ -540,7 +591,8 @@ interface WithPublicNetworkAccess { /** The template for a Redis Cache update operation, containing all the settings that can be modified. */ interface Update extends Appliable, Resource.UpdateWithTags, UpdateStages.WithSku, - UpdateStages.WithNonSslPort, UpdateStages.WithRedisConfiguration, UpdateStages.WithPublicNetworkAccess { + UpdateStages.WithNonSslPort, UpdateStages.WithRedisConfiguration, UpdateStages.WithPublicNetworkAccess, + UpdateStages.WithAccessKeyAuthentication { /** * The number of shards to be created on a Premium Cluster Cache. * diff --git a/sdk/redis/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java b/sdk/redis/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java index c4b260c5684c..cb3b42432ea5 100644 --- a/sdk/redis/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java +++ b/sdk/redis/azure-resourcemanager-redis/src/test/java/com/azure/resourcemanager/redis/RedisCacheOperationsTests.java @@ -3,7 +3,6 @@ package com.azure.resourcemanager.redis; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.Region; import com.azure.core.management.exception.ManagementException; import com.azure.resourcemanager.redis.models.DayOfWeek; @@ -49,22 +48,27 @@ public void canCRUDRedisCache() throws Exception { .define(rrName) .withRegion(Region.ASIA_EAST) .withNewResourceGroup(rgName) - .withBasicSku(); + .withBasicSku() + .withRedisConfiguration("aad-enabled", "true") + .disableAccessKeyAuthentication(); Creatable redisCacheDefinition2 = redisManager.redisCaches() .define(rrNameSecond) .withRegion(Region.US_CENTRAL) .withNewResourceGroup(resourceGroups) .withPremiumSku() .withShardCount(2) - .withPatchSchedule(DayOfWeek.SUNDAY, 10, Duration.ofMinutes(302)); + .withPatchSchedule(DayOfWeek.SUNDAY, 10, Duration.ofMinutes(302)) + .withRedisConfiguration("aad-enabled", "true") + .disableAccessKeyAuthentication(); Creatable redisCacheDefinition3 = redisManager.redisCaches() .define(rrNameThird) .withRegion(Region.US_CENTRAL) .withNewResourceGroup(resourceGroups) .withPremiumSku(2) - .withNonSslPort() .withFirewallRule("rule1", "192.168.0.1", "192.168.0.4") - .withFirewallRule("rule2", "192.168.0.10", "192.168.0.40"); + .withFirewallRule("rule2", "192.168.0.10", "192.168.0.40") + .withRedisConfiguration("aad-enabled", "true") + .disableAccessKeyAuthentication(); // Server throws "The 'minimumTlsVersion' property is not yet supported." exception. Uncomment when fixed. // .withMinimumTlsVersion(TlsVersion.ONE_FULL_STOP_ONE); @@ -221,6 +225,8 @@ public void canRedisVersionUpdate() { .withNewResourceGroup(rgName) .withBasicSku() .withRedisVersion(redisVersion) + .withRedisConfiguration("aad-enabled", "true") + .disableAccessKeyAuthentication() .create(); assertSameVersion(RedisCache.RedisVersion.V4, redisCache.redisVersion()); @@ -250,9 +256,10 @@ public void canCRUDLinkedServers() throws Exception { .withPremiumSku(2) .withPatchSchedule(DayOfWeek.SATURDAY, 5, Duration.ofHours(5)) .withRedisConfiguration("maxclients", "2") - .withNonSslPort() .withFirewallRule("rule1", "192.168.0.1", "192.168.0.4") .withFirewallRule("rule2", "192.168.0.10", "192.168.0.40") + .withRedisConfiguration("aad-enabled", "true") + .disableAccessKeyAuthentication() .create(); RedisCache rggLinked = redisManager.redisCaches() @@ -260,6 +267,8 @@ public void canCRUDLinkedServers() throws Exception { .withRegion(Region.US_EAST) .withExistingResourceGroup(rgNameSecond) .withPremiumSku(2) + .withRedisConfiguration("aad-enabled", "true") + .disableAccessKeyAuthentication() .create(); Assertions.assertNotNull(rgg); @@ -303,11 +312,9 @@ public void canCreateRedisWithRdbAof() { .define(saName) .withRegion(Region.US_WEST3) .withNewResourceGroup(rgName) + .disableSharedKeyAccess() .create(); - String connectionString = ResourceManagerUtils.getStorageConnectionString(saName, - storageAccount.getKeys().get(0).value(), AzureEnvironment.AZURE); - // RDB RedisCache redisCache = redisManager.redisCaches() .define(rrName) @@ -318,7 +325,10 @@ public void canCreateRedisWithRdbAof() { .withRedisConfiguration(new RedisConfiguration().withRdbBackupEnabled("true") .withRdbBackupFrequency("15") .withRdbBackupMaxSnapshotCount("1") - .withRdbStorageConnectionString(connectionString)) + .withRdbStorageConnectionString(storageAccount.endPoints().primary().blob()) + .withPreferredDataPersistenceAuthMethod("managedIdentity") + .withAadEnabled("true")) + .disableAccessKeyAuthentication() .create(); Assertions.assertEquals("true", redisCache.innerModel().redisConfiguration().rdbBackupEnabled()); Assertions.assertEquals("15", redisCache.innerModel().redisConfiguration().rdbBackupFrequency()); @@ -336,13 +346,14 @@ public void canCreateRedisWithRdbAof() { .withPremiumSku() .withMinimumTlsVersion(TlsVersion.ONE_TWO) .withRedisConfiguration("aof-backup-enabled", "true") - .withRedisConfiguration("aof-storage-connection-string-0", connectionString) - .withRedisConfiguration("aof-storage-connection-string-1", connectionString) + .withRedisConfiguration("aof-storage-connection-string-0", storageAccount.endPoints().primary().blob()) + .withRedisConfiguration("preferred-data-persistence-auth-method", "managedIdentity") + .withRedisConfiguration("aad-enabled", "true") + .disableAccessKeyAuthentication() .create(); Assertions.assertEquals("true", redisCache.innerModel().redisConfiguration().aofBackupEnabled()); if (!isPlaybackMode()) { Assertions.assertNotNull(redisCache.innerModel().redisConfiguration().aofStorageConnectionString0()); - Assertions.assertNotNull(redisCache.innerModel().redisConfiguration().aofStorageConnectionString1()); } assertSameVersion(RedisCache.RedisVersion.V6, redisCache.redisVersion()); @@ -371,8 +382,11 @@ public void canUpdatePublicNetworkAccess() { .withRegion(Region.ASIA_EAST) .withNewResourceGroup(rgName) .withBasicSku() + .withRedisConfiguration("aad-enabled", "true") + .disableAccessKeyAuthentication() .create(); + Assertions.assertTrue(!redisCache.isAccessKeyAuthenticationEnabled()); redisCache.update().disablePublicNetworkAccess().apply(); Assertions.assertEquals(PublicNetworkAccess.DISABLED, redisCache.publicNetworkAccess()); diff --git a/sdk/resourcemanager/README.md b/sdk/resourcemanager/README.md index 153586d66271..81074c382148 100644 --- a/sdk/resourcemanager/README.md +++ b/sdk/resourcemanager/README.md @@ -68,7 +68,7 @@ For your convenience, we have provided a multi-service package that includes som com.azure.resourcemanager azure-resourcemanager - 2.56.0 + 2.58.0 ``` [//]: # ({x-version-update-end}) @@ -330,7 +330,7 @@ For example, here is sample maven dependency for Compute package. com.azure.resourcemanager azure-resourcemanager-compute - 2.55.0 + 2.55.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/resourcemanager/api-specs.json b/sdk/resourcemanager/api-specs.json index a8cf8499f518..f71a57eafabb 100644 --- a/sdk/resourcemanager/api-specs.json +++ b/sdk/resourcemanager/api-specs.json @@ -60,6 +60,13 @@ "package": "com.azure.resourcemanager.containerregistry", "args": "--tag=package-2025-11 --modelerfour.lenient-model-deduplication=true --enable-sync-stack=false" }, + "containerregistrytasks": { + "dir": "../containerregistry/azure-resourcemanager-containerregistry", + "source": "specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/readme.md", + "package": "com.azure.resourcemanager.containerregistry", + "args": "--tag=package-2019-06-preview --title=ContainerRegistryTasksManagementClient --rename-operation-group:Registries:RegistryTasks --rename-model=DockerBuildStep:DockerTaskStep --modelerfour.lenient-model-deduplication=true --metadata-suffix=registrytasks --enable-sync-stack=false", + "note": "Use commit 09695f5a97dfcf201766ea2f2e7e3b53aec49144 for Swagger before TypeSpec migration" + }, "containerregistry-hybrid": { "dir": "../resourcemanagerhybrid/azure-resourcemanager-containerregistry", "source": "specification/containerregistry/resource-manager/readme.md", diff --git a/sdk/resourcemanager/azure-resourcemanager-perf/pom.xml b/sdk/resourcemanager/azure-resourcemanager-perf/pom.xml index 550b785fe022..8186a7deb349 100644 --- a/sdk/resourcemanager/azure-resourcemanager-perf/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-perf/pom.xml @@ -25,7 +25,7 @@ com.azure.resourcemanager azure-resourcemanager - 2.58.0-beta.1 + 2.59.0-beta.1 com.azure.resourcemanager diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/README.md b/sdk/resourcemanager/azure-resourcemanager-samples/README.md index 5a97bd8de940..3e1b4296136d 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/README.md +++ b/sdk/resourcemanager/azure-resourcemanager-samples/README.md @@ -17,7 +17,7 @@ For documentation on how to use this package, please see [Azure Management Libra com.azure.resourcemanager azure-resourcemanager - 2.53.1 + 2.58.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml b/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml index 5d303163e374..c1631b0c40da 100644 --- a/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager-samples/pom.xml @@ -54,7 +54,7 @@ com.azure.resourcemanager azure-resourcemanager - 2.58.0-beta.1 + 2.59.0-beta.1 com.azure.resourcemanager diff --git a/sdk/resourcemanager/azure-resourcemanager-test/README.md b/sdk/resourcemanager/azure-resourcemanager-test/README.md index 5a86fcf28e25..2cbacb3e0264 100644 --- a/sdk/resourcemanager/azure-resourcemanager-test/README.md +++ b/sdk/resourcemanager/azure-resourcemanager-test/README.md @@ -17,7 +17,7 @@ For documentation on how to use this package, please see [Azure Management Libra com.azure.resourcemanager azure-resourcemanager-test - 2.0.0-beta.1 + 2.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/resourcemanager/azure-resourcemanager/CHANGELOG.md b/sdk/resourcemanager/azure-resourcemanager/CHANGELOG.md index 7f96bdbf5635..286bf5209860 100644 --- a/sdk/resourcemanager/azure-resourcemanager/CHANGELOG.md +++ b/sdk/resourcemanager/azure-resourcemanager/CHANGELOG.md @@ -1,6 +1,16 @@ # Release History -## 2.58.0-beta.1 (Unreleased) +## 2.59.0-beta.1 (Unreleased) + +### azure-resourcemanager-redis + +#### Features Added + +- Supported enabling/disabling authentication through access keys for `RedisCache`. + +### Other Changes + +## 2.58.0 (2025-12-22) ### azure-resourcemanager-containerservice @@ -8,6 +18,12 @@ - Updated `api-version` to `2025-10-01`. +### Other Changes + +#### Dependency Updates + +- Updated core dependency from resources. + ## 2.57.0 (2025-11-25) ### azure-resourcemanager-containerregistry diff --git a/sdk/resourcemanager/azure-resourcemanager/README.md b/sdk/resourcemanager/azure-resourcemanager/README.md index ee877ed2878c..e2fc3b20e159 100644 --- a/sdk/resourcemanager/azure-resourcemanager/README.md +++ b/sdk/resourcemanager/azure-resourcemanager/README.md @@ -18,7 +18,7 @@ For documentation on how to use this package, please see [Azure Management Libra com.azure.resourcemanager azure-resourcemanager - 2.57.0 + 2.58.0 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/resourcemanager/azure-resourcemanager/pom.xml b/sdk/resourcemanager/azure-resourcemanager/pom.xml index 8f207f38ac62..3978e068999e 100644 --- a/sdk/resourcemanager/azure-resourcemanager/pom.xml +++ b/sdk/resourcemanager/azure-resourcemanager/pom.xml @@ -15,7 +15,7 @@ com.azure.resourcemanager azure-resourcemanager - 2.58.0-beta.1 + 2.59.0-beta.1 jar Microsoft Azure SDK for Management diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsCreateSamples.java deleted file mode 100644 index 5bd0598f3928..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsCreateSamples.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -import com.azure.resourcemanager.containerregistry.fluent.models.AgentPoolInner; -import com.azure.resourcemanager.containerregistry.models.OS; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for AgentPools Create. - */ -public final class AgentPoolsCreateSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/AgentPoolsCreate.json - */ - /** - * Sample code: AgentPools_Create. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void agentPoolsCreate(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getAgentPools() - .create("myResourceGroup", "myRegistry", "myAgentPool", - new AgentPoolInner().withLocation("WESTUS") - .withTags(mapOf("key", "fakeTokenPlaceholder")) - .withCount(1) - .withTier("S1") - .withOs(OS.LINUX), - 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/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsDeleteSamples.java deleted file mode 100644 index 4653c799e546..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsDeleteSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for AgentPools Delete. - */ -public final class AgentPoolsDeleteSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/AgentPoolsDelete.json - */ - /** - * Sample code: AgentPools_Delete. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void agentPoolsDelete(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getAgentPools() - .delete("myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetQueueStatusSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetQueueStatusSamples.java deleted file mode 100644 index 3b2da9466dea..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetQueueStatusSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for AgentPools GetQueueStatus. - */ -public final class AgentPoolsGetQueueStatusSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/AgentPoolsGetQueueStatus.json - */ - /** - * Sample code: AgentPools_GetQueueStatus. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void agentPoolsGetQueueStatus(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getAgentPools() - .getQueueStatusWithResponse("myResourceGroup", "myRegistry", "myAgentPool", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetSamples.java deleted file mode 100644 index db9d74a75d3b..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsGetSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for AgentPools Get. - */ -public final class AgentPoolsGetSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/AgentPoolsGet.json - */ - /** - * Sample code: AgentPools_Get. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void agentPoolsGet(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getAgentPools() - .getWithResponse("myResourceGroup", "myRegistry", "myAgentPool", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsListSamples.java deleted file mode 100644 index 38265047f179..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsListSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for AgentPools List. - */ -public final class AgentPoolsListSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/AgentPoolsList.json - */ - /** - * Sample code: AgentPools_List. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void agentPoolsList(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getAgentPools() - .list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsUpdateSamples.java deleted file mode 100644 index 6afcbe47db6c..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/AgentPoolsUpdateSamples.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -import com.azure.resourcemanager.containerregistry.models.AgentPoolUpdateParameters; - -/** - * Samples for AgentPools Update. - */ -public final class AgentPoolsUpdateSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/AgentPoolsUpdate.json - */ - /** - * Sample code: AgentPools_Update. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void agentPoolsUpdate(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getAgentPools() - .update("myResourceGroup", "myRegistry", "myAgentPool", new AgentPoolUpdateParameters().withCount(1), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGetBuildSourceUploadUrlSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGetBuildSourceUploadUrlSamples.java deleted file mode 100644 index 7c43347fb415..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesGetBuildSourceUploadUrlSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for Registries GetBuildSourceUploadUrl. - */ -public final class RegistriesGetBuildSourceUploadUrlSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RegistriesGetBuildSourceUploadUrl.json - */ - /** - * Sample code: Registries_GetBuildSourceUploadUrl. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void registriesGetBuildSourceUploadUrl(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRegistries() - .getBuildSourceUploadUrlWithResponse("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesScheduleRunSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesScheduleRunSamples.java deleted file mode 100644 index ada79dc90a6f..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RegistriesScheduleRunSamples.java +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.Architecture; -import com.azure.resourcemanager.containerregistry.models.Argument; -import com.azure.resourcemanager.containerregistry.models.Credentials; -import com.azure.resourcemanager.containerregistry.models.CustomRegistryCredentials; -import com.azure.resourcemanager.containerregistry.models.DockerBuildRequest; -import com.azure.resourcemanager.containerregistry.models.EncodedTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.FileTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.OS; -import com.azure.resourcemanager.containerregistry.models.OverrideTaskStepProperties; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.SecretObject; -import com.azure.resourcemanager.containerregistry.models.SecretObjectType; -import com.azure.resourcemanager.containerregistry.models.SetValue; -import com.azure.resourcemanager.containerregistry.models.SourceRegistryCredentials; -import com.azure.resourcemanager.containerregistry.models.SourceRegistryLoginMode; -import com.azure.resourcemanager.containerregistry.models.TaskRunRequest; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for Registries ScheduleRun. - */ -public final class RegistriesScheduleRunSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RegistriesScheduleRun_FileTaskRun.json - */ - /** - * Sample code: Registries_ScheduleRun_FileTaskRun. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void registriesScheduleRunFileTaskRun(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRegistries() - .scheduleRun("myResourceGroup", "myRegistry", new FileTaskRunRequest().withTaskFilePath("acb.yaml") - .withValuesFilePath("prod-values.yaml") - .withValues(Arrays.asList( - new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new SetValue().withName("mysecrettestargument").withValue("mysecrettestvalue").withIsSecret(true))) - .withPlatform(new PlatformProperties().withOs(OS.LINUX)) - .withAgentConfiguration(new AgentProperties().withCpu(2)) - .withSourceLocation( - "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RegistriesScheduleRun.json - */ - /** - * Sample code: Registries_ScheduleRun. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void registriesScheduleRun(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRegistries() - .scheduleRun("myResourceGroup", "myRegistry", new DockerBuildRequest().withIsArchiveEnabled(true) - .withImageNames(Arrays.asList("azurerest:testtag")) - .withIsPushEnabled(true) - .withNoCache(true) - .withDockerFilePath("DockerFile") - .withArguments(Arrays.asList( - new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new Argument().withName("mysecrettestargument").withValue("mysecrettestvalue").withIsSecret(true))) - .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) - .withAgentConfiguration(new AgentProperties().withCpu(2)) - .withSourceLocation( - "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RegistriesScheduleRun_EncodedTaskRun.json - */ - /** - * Sample code: Registries_ScheduleRun_EncodedTaskRun. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void registriesScheduleRunEncodedTaskRun(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRegistries() - .scheduleRun("myResourceGroup", "myRegistry", new EncodedTaskRunRequest() - .withEncodedTaskContent("fakeTokenPlaceholder") - .withEncodedValuesContent("fakeTokenPlaceholder") - .withValues(Arrays.asList( - new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new SetValue().withName("mysecrettestargument").withValue("mysecrettestvalue").withIsSecret(true))) - .withPlatform(new PlatformProperties().withOs(OS.LINUX)) - .withAgentConfiguration(new AgentProperties().withCpu(2)), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RegistriesScheduleRun_WithCustomCredentials.json - */ - /** - * Sample code: Registries_ScheduleRun_WithCustomCredentials. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void - registriesScheduleRunWithCustomCredentials(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRegistries() - .scheduleRun("myResourceGroup", "myRegistry", new DockerBuildRequest().withIsArchiveEnabled(true) - .withImageNames(Arrays.asList("azurerest:testtag")) - .withIsPushEnabled(true) - .withNoCache(true) - .withDockerFilePath("DockerFile") - .withTarget("stage1") - .withArguments(Arrays.asList( - new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new Argument().withName("mysecrettestargument").withValue("mysecrettestvalue").withIsSecret(true))) - .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) - .withAgentConfiguration(new AgentProperties().withCpu(2)) - .withSourceLocation( - "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D") - .withCredentials(new Credentials() - .withSourceRegistry(new SourceRegistryCredentials().withLoginMode(SourceRegistryLoginMode.DEFAULT)) - .withCustomRegistries(mapOf("myregistry.azurecr.io", - new CustomRegistryCredentials() - .withUsername(new SecretObject().withValue("reg1").withType(SecretObjectType.OPAQUE)) - .withPassword(new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE)), - "myregistry2.azurecr.io", - new CustomRegistryCredentials() - .withUsername(new SecretObject().withValue("reg2").withType(SecretObjectType.OPAQUE)) - .withPassword(new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RegistriesScheduleRun_WithLogTemplate.json - */ - /** - * Sample code: Registries_ScheduleRun_WithLogTemplate. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void registriesScheduleRunWithLogTemplate(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRegistries() - .scheduleRun("myResourceGroup", "myRegistry", new DockerBuildRequest().withIsArchiveEnabled(true) - .withLogTemplate("acr/tasks:{{.Run.OS}}") - .withImageNames(Arrays.asList("azurerest:testtag")) - .withIsPushEnabled(true) - .withNoCache(true) - .withDockerFilePath("DockerFile") - .withArguments(Arrays.asList( - new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new Argument().withName("mysecrettestargument").withValue("mysecrettestvalue").withIsSecret(true))) - .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) - .withAgentConfiguration(new AgentProperties().withCpu(2)) - .withSourceLocation( - "https://myaccount.blob.core.windows.net/sascontainer/source.zip?sv=2015-04-05&st=2015-04-29T22%3A18%3A26Z&se=2015-04-30T02%3A23%3A26Z&sr=b&sp=rw&sip=168.1.5.60-168.1.5.70&spr=https&sig=Z%2FRHIX5Xcg0Mq2rqI3OlWTjEg2tYkboXr1P9ZUXDtkk%3D"), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RegistriesScheduleRun_Task.json - */ - /** - * Sample code: Registries_ScheduleRun_Task. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void registriesScheduleRunTask(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRegistries() - .scheduleRun("myResourceGroup", "myRegistry", - new TaskRunRequest().withTaskId("myTask") - .withOverrideTaskStepProperties(new OverrideTaskStepProperties().withFile("overriddenDockerfile") - .withArguments(Arrays.asList( - new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new Argument().withName("mysecrettestargument") - .withValue("mysecrettestvalue") - .withIsSecret(true))) - .withTarget("build") - .withValues(Arrays.asList( - new SetValue().withName("mytestname").withValue("mytestvalue").withIsSecret(false), - new SetValue().withName("mysecrettestname") - .withValue("mysecrettestvalue") - .withIsSecret(true))) - .withUpdateTriggerToken("fakeTokenPlaceholder")), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RegistriesScheduleRun_FileTask_WithCustomCredentials.json - */ - /** - * Sample code: Registries_ScheduleRun_Task_WithCustomCredentials. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void - registriesScheduleRunTaskWithCustomCredentials(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRegistries() - .scheduleRun("myResourceGroup", "myRegistry", new FileTaskRunRequest().withTaskFilePath("acb.yaml") - .withValues(Arrays.asList( - new SetValue().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new SetValue().withName("mysecrettestargument").withValue("mysecrettestvalue").withIsSecret(true))) - .withPlatform(new PlatformProperties().withOs(OS.LINUX)) - .withCredentials(new Credentials() - .withSourceRegistry(new SourceRegistryCredentials().withLoginMode(SourceRegistryLoginMode.DEFAULT)) - .withCustomRegistries(mapOf("myregistry.azurecr.io", - new CustomRegistryCredentials() - .withUsername(new SecretObject().withValue("reg1").withType(SecretObjectType.OPAQUE)) - .withPassword(new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))), - 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/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsCancelSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsCancelSamples.java deleted file mode 100644 index f5df32e3d256..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsCancelSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for Runs Cancel. - */ -public final class RunsCancelSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RunsCancel.json - */ - /** - * Sample code: Runs_Cancel. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void runsCancel(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRuns() - .cancel("myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetLogSasUrlSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetLogSasUrlSamples.java deleted file mode 100644 index 89bcc1f99d94..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetLogSasUrlSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for Runs GetLogSasUrl. - */ -public final class RunsGetLogSasUrlSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RunsGetLogSasUrl.json - */ - /** - * Sample code: Runs_GetLogSasUrl. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void runsGetLogSasUrl(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRuns() - .getLogSasUrlWithResponse("myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetSamples.java deleted file mode 100644 index 744111be1063..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsGetSamples.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for Runs Get. - */ -public final class RunsGetSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RunsGet.json - */ - /** - * Sample code: Runs_Get. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void runsGet(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRuns() - .getWithResponse("myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsListSamples.java deleted file mode 100644 index 072b46aeffe2..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsListSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for Runs List. - */ -public final class RunsListSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RunsList.json - */ - /** - * Sample code: Runs_List. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void runsList(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRuns() - .list("myResourceGroup", "myRegistry", "", 10, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsUpdateSamples.java deleted file mode 100644 index 45d02386ffde..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/RunsUpdateSamples.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -import com.azure.resourcemanager.containerregistry.models.RunUpdateParameters; - -/** - * Samples for Runs Update. - */ -public final class RunsUpdateSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/RunsUpdate.json - */ - /** - * Sample code: Runs_Update. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void runsUpdate(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getRuns() - .update("myResourceGroup", "myRegistry", "0accec26-d6de-4757-8e74-d080f38eaaab", - new RunUpdateParameters().withIsArchiveEnabled(true), com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsCreateSamples.java deleted file mode 100644 index 9cd0df37051e..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsCreateSamples.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -import com.azure.resourcemanager.containerregistry.fluent.models.TaskRunInner; -import com.azure.resourcemanager.containerregistry.models.Architecture; -import com.azure.resourcemanager.containerregistry.models.Credentials; -import com.azure.resourcemanager.containerregistry.models.EncodedTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.OS; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import java.util.Arrays; - -/** - * Samples for TaskRuns Create. - */ -public final class TaskRunsCreateSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TaskRunsCreate.json - */ - /** - * Sample code: TaskRuns_Create. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void taskRunsCreate(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTaskRuns() - .create("myResourceGroup", "myRegistry", "myRun", - new TaskRunInner() - .withRunRequest(new EncodedTaskRunRequest().withEncodedTaskContent("fakeTokenPlaceholder") - .withEncodedValuesContent("fakeTokenPlaceholder") - .withValues(Arrays.asList()) - .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) - .withCredentials(new Credentials())) - .withForceUpdateTag("test"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsDeleteSamples.java deleted file mode 100644 index 0b86aa39d1c6..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsDeleteSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for TaskRuns Delete. - */ -public final class TaskRunsDeleteSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TaskRunsDelete.json - */ - /** - * Sample code: TaskRuns_Delete. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void taskRunsDelete(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTaskRuns() - .delete("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetDetailsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetDetailsSamples.java deleted file mode 100644 index 3e119ef243a2..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetDetailsSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for TaskRuns GetDetails. - */ -public final class TaskRunsGetDetailsSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TaskRunsGetDetails.json - */ - /** - * Sample code: TaskRuns_GetDetails. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void taskRunsGetDetails(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTaskRuns() - .getDetailsWithResponse("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetSamples.java deleted file mode 100644 index 8ad7cb58bad4..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsGetSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for TaskRuns Get. - */ -public final class TaskRunsGetSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TaskRunsGet.json - */ - /** - * Sample code: TaskRuns_Get. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void taskRunsGet(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTaskRuns() - .getWithResponse("myResourceGroup", "myRegistry", "myRun", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsListSamples.java deleted file mode 100644 index 0435b14aa691..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsListSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for TaskRuns List. - */ -public final class TaskRunsListSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TaskRunsList.json - */ - /** - * Sample code: TaskRuns_List. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void taskRunsList(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTaskRuns() - .list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsUpdateSamples.java deleted file mode 100644 index f03f581124b5..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TaskRunsUpdateSamples.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -import com.azure.resourcemanager.containerregistry.models.Architecture; -import com.azure.resourcemanager.containerregistry.models.Credentials; -import com.azure.resourcemanager.containerregistry.models.EncodedTaskRunRequest; -import com.azure.resourcemanager.containerregistry.models.OS; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.TaskRunUpdateParameters; -import java.util.Arrays; - -/** - * Samples for TaskRuns Update. - */ -public final class TaskRunsUpdateSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TaskRunsUpdate.json - */ - /** - * Sample code: TaskRuns_Update. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void taskRunsUpdate(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTaskRuns() - .update("myResourceGroup", "myRegistry", "myRun", - new TaskRunUpdateParameters().withRunRequest(new EncodedTaskRunRequest().withIsArchiveEnabled(true) - .withEncodedTaskContent("fakeTokenPlaceholder") - .withEncodedValuesContent("fakeTokenPlaceholder") - .withValues(Arrays.asList()) - .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) - .withCredentials(new Credentials())).withForceUpdateTag("test"), - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksCreateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksCreateSamples.java deleted file mode 100644 index 19f4ea81643b..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksCreateSamples.java +++ /dev/null @@ -1,294 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -import com.azure.resourcemanager.containerregistry.fluent.models.TaskInner; -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.Architecture; -import com.azure.resourcemanager.containerregistry.models.Argument; -import com.azure.resourcemanager.containerregistry.models.AuthInfo; -import com.azure.resourcemanager.containerregistry.models.BaseImageTrigger; -import com.azure.resourcemanager.containerregistry.models.BaseImageTriggerType; -import com.azure.resourcemanager.containerregistry.models.DockerTaskStep; -import com.azure.resourcemanager.containerregistry.models.IdentityProperties; -import com.azure.resourcemanager.containerregistry.models.OS; -import com.azure.resourcemanager.containerregistry.models.PlatformProperties; -import com.azure.resourcemanager.containerregistry.models.ResourceIdentityType; -import com.azure.resourcemanager.containerregistry.models.SourceControlType; -import com.azure.resourcemanager.containerregistry.models.SourceProperties; -import com.azure.resourcemanager.containerregistry.models.SourceTrigger; -import com.azure.resourcemanager.containerregistry.models.SourceTriggerEvent; -import com.azure.resourcemanager.containerregistry.models.TaskStatus; -import com.azure.resourcemanager.containerregistry.models.TimerTrigger; -import com.azure.resourcemanager.containerregistry.models.TokenType; -import com.azure.resourcemanager.containerregistry.models.TriggerProperties; -import com.azure.resourcemanager.containerregistry.models.UpdateTriggerPayloadType; -import com.azure.resourcemanager.containerregistry.models.UserIdentityProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for Tasks Create. - */ -public final class TasksCreateSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/ManagedIdentity/TasksCreate_WithSystemIdentity.json - */ - /** - * Sample code: Tasks_Create_WithUserIdentities_WithSystemIdentity. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void - tasksCreateWithUserIdentitiesWithSystemIdentity(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .create("myResourceGroup", "myRegistry", "mytTask", - new TaskInner().withLocation("eastus") - .withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withStatus(TaskStatus.ENABLED) - .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) - .withAgentConfiguration(new AgentProperties().withCpu(2)) - .withStep(new DockerTaskStep().withContextPath("src") - .withImageNames(Arrays.asList("azurerest:testtag")) - .withIsPushEnabled(true) - .withNoCache(false) - .withDockerFilePath("src/DockerFile") - .withArguments(Arrays.asList( - new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new Argument().withName("mysecrettestargument") - .withValue("mysecrettestvalue") - .withIsSecret(true)))) - .withTrigger( - new TriggerProperties() - .withTimerTriggers(Arrays - .asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) - .withSourceTriggers(Arrays.asList(new SourceTrigger() - .withSourceRepository( - new SourceProperties().withSourceControlType(SourceControlType.GITHUB) - .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") - .withBranch("master") - .withSourceControlAuthProperties(new AuthInfo().withTokenType(TokenType.PAT) - .withToken("fakeTokenPlaceholder"))) - .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) - .withName("mySourceTrigger"))) - .withBaseImageTrigger( - new BaseImageTrigger().withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) - .withName("myBaseImageTrigger"))) - .withIsSystemTask(false), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TasksCreate.json - */ - /** - * Sample code: Tasks_Create. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksCreate(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .create("myResourceGroup", "myRegistry", "mytTask", - new TaskInner().withLocation("eastus") - .withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) - .withStatus(TaskStatus.ENABLED) - .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) - .withAgentConfiguration(new AgentProperties().withCpu(2)) - .withStep(new DockerTaskStep().withContextPath("src") - .withImageNames(Arrays.asList("azurerest:testtag")) - .withIsPushEnabled(true) - .withNoCache(false) - .withDockerFilePath("src/DockerFile") - .withArguments(Arrays.asList( - new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new Argument().withName("mysecrettestargument") - .withValue("mysecrettestvalue") - .withIsSecret(true)))) - .withTrigger( - new TriggerProperties() - .withTimerTriggers(Arrays - .asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) - .withSourceTriggers(Arrays.asList(new SourceTrigger() - .withSourceRepository( - new SourceProperties().withSourceControlType(SourceControlType.GITHUB) - .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") - .withBranch("master") - .withSourceControlAuthProperties(new AuthInfo().withTokenType(TokenType.PAT) - .withToken("fakeTokenPlaceholder"))) - .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) - .withName("mySourceTrigger"))) - .withBaseImageTrigger( - new BaseImageTrigger().withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) - .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo") - .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.TOKEN) - .withName("myBaseImageTrigger"))) - .withLogTemplate("acr/tasks:{{.Run.OS}}") - .withIsSystemTask(false), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/ManagedIdentity/TasksCreate_WithSystemAndUserIdentities.json - */ - /** - * Sample code: Tasks_Create_WithSystemAndUserIdentities. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksCreateWithSystemAndUserIdentities(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .create("myResourceGroup", "myRegistry", "mytTask", new TaskInner().withLocation("eastus") - .withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withIdentity(new IdentityProperties().withType(ResourceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", - new UserIdentityProperties()))) - .withStatus(TaskStatus.ENABLED) - .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) - .withAgentConfiguration(new AgentProperties().withCpu(2)) - .withStep(new DockerTaskStep().withContextPath("src") - .withImageNames(Arrays.asList("azurerest:testtag")) - .withIsPushEnabled(true) - .withNoCache(false) - .withDockerFilePath("src/DockerFile") - .withArguments(Arrays.asList( - new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new Argument().withName("mysecrettestargument") - .withValue("mysecrettestvalue") - .withIsSecret(true)))) - .withTrigger( - new TriggerProperties() - .withTimerTriggers( - Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) - .withSourceTriggers( - Arrays.asList(new SourceTrigger() - .withSourceRepository( - new SourceProperties().withSourceControlType(SourceControlType.GITHUB) - .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") - .withBranch("master") - .withSourceControlAuthProperties(new AuthInfo().withTokenType(TokenType.PAT) - .withToken("fakeTokenPlaceholder"))) - .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) - .withName("mySourceTrigger"))) - .withBaseImageTrigger( - new BaseImageTrigger().withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) - .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo") - .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.DEFAULT) - .withName("myBaseImageTrigger"))) - .withIsSystemTask(false), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/ManagedIdentity/TasksCreate_WithUserIdentities.json - */ - /** - * Sample code: Tasks_Create_WithUserIdentities. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksCreateWithUserIdentities(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .create("myResourceGroup", "myRegistry", "mytTask", new TaskInner().withLocation("eastus") - .withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withIdentity(new IdentityProperties().withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf( - "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1", - new UserIdentityProperties(), - "/subscriptions/f9d7ebed-adbd-4cb4-b973-aaf82c136138/resourcegroups/myResourceGroup1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2", - new UserIdentityProperties()))) - .withStatus(TaskStatus.ENABLED) - .withPlatform(new PlatformProperties().withOs(OS.LINUX).withArchitecture(Architecture.AMD64)) - .withAgentConfiguration(new AgentProperties().withCpu(2)) - .withStep(new DockerTaskStep().withContextPath("src") - .withImageNames(Arrays.asList("azurerest:testtag")) - .withIsPushEnabled(true) - .withNoCache(false) - .withDockerFilePath("src/DockerFile") - .withArguments(Arrays.asList( - new Argument().withName("mytestargument").withValue("mytestvalue").withIsSecret(false), - new Argument().withName("mysecrettestargument") - .withValue("mysecrettestvalue") - .withIsSecret(true)))) - .withTrigger( - new TriggerProperties() - .withTimerTriggers( - Arrays.asList(new TimerTrigger().withSchedule("30 9 * * 1-5").withName("myTimerTrigger"))) - .withSourceTriggers( - Arrays.asList(new SourceTrigger() - .withSourceRepository( - new SourceProperties().withSourceControlType(SourceControlType.GITHUB) - .withRepositoryUrl("https://github.com/Azure/azure-rest-api-specs") - .withBranch("master") - .withSourceControlAuthProperties(new AuthInfo().withTokenType(TokenType.PAT) - .withToken("fakeTokenPlaceholder"))) - .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) - .withName("mySourceTrigger"))) - .withBaseImageTrigger( - new BaseImageTrigger().withBaseImageTriggerType(BaseImageTriggerType.RUNTIME) - .withUpdateTriggerEndpoint("https://user:pass@mycicd.webhook.com?token=foo") - .withUpdateTriggerPayloadType(UpdateTriggerPayloadType.DEFAULT) - .withName("myBaseImageTrigger"))) - .withIsSystemTask(false), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TasksCreate_QuickTask.json - */ - /** - * Sample code: Tasks_Create_QuickTask. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksCreateQuickTask(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .create("myResourceGroup", "myRegistry", "quicktask", - new TaskInner().withLocation("eastus") - .withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withStatus(TaskStatus.ENABLED) - .withLogTemplate("acr/tasks:{{.Run.OS}}") - .withIsSystemTask(true), - 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/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksDeleteSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksDeleteSamples.java deleted file mode 100644 index d3cc36c484f9..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksDeleteSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for Tasks Delete. - */ -public final class TasksDeleteSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TasksDelete.json - */ - /** - * Sample code: Tasks_Delete. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksDelete(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .delete("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetDetailsSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetDetailsSamples.java deleted file mode 100644 index 9ca46b952813..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetDetailsSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for Tasks GetDetails. - */ -public final class TasksGetDetailsSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TasksGetDetails.json - */ - /** - * Sample code: Tasks_GetDetails. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksGetDetails(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .getDetailsWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetSamples.java deleted file mode 100644 index f89c59da7498..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksGetSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for Tasks Get. - */ -public final class TasksGetSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TasksGet.json - */ - /** - * Sample code: Tasks_Get. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksGet(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .getWithResponse("myResourceGroup", "myRegistry", "myTask", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksListSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksListSamples.java deleted file mode 100644 index 3245408aec8a..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksListSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -/** - * Samples for Tasks List. - */ -public final class TasksListSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TasksList.json - */ - /** - * Sample code: Tasks_List. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksList(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .list("myResourceGroup", "myRegistry", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksUpdateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksUpdateSamples.java deleted file mode 100644 index 7fff27d5b31c..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/containerregistry/generated/TasksUpdateSamples.java +++ /dev/null @@ -1,208 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.containerregistry.generated; - -import com.azure.resourcemanager.containerregistry.models.AgentProperties; -import com.azure.resourcemanager.containerregistry.models.AuthInfoUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.Credentials; -import com.azure.resourcemanager.containerregistry.models.CustomRegistryCredentials; -import com.azure.resourcemanager.containerregistry.models.DockerBuildStepUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.SecretObject; -import com.azure.resourcemanager.containerregistry.models.SecretObjectType; -import com.azure.resourcemanager.containerregistry.models.SourceTriggerEvent; -import com.azure.resourcemanager.containerregistry.models.SourceTriggerUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.SourceUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.TaskStatus; -import com.azure.resourcemanager.containerregistry.models.TaskUpdateParameters; -import com.azure.resourcemanager.containerregistry.models.TokenType; -import com.azure.resourcemanager.containerregistry.models.TriggerUpdateParameters; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for Tasks Update. - */ -public final class TasksUpdateSamples { - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TasksUpdate_QuickTask.json - */ - /** - * Sample code: Tasks_Update_QuickTask. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksUpdateQuickTask(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .update("myResourceGroup", "myRegistry", "quicktask", - new TaskUpdateParameters().withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withStatus(TaskStatus.ENABLED) - .withLogTemplate("acr/tasks:{{.Run.OS}}"), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/ManagedIdentity/TasksUpdate_WithMSICustomCredentials.json - */ - /** - * Sample code: Tasks_Update_WithMSICustomCredentials. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksUpdateWithMSICustomCredentials(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .update("myResourceGroup", "myRegistry", "myTask", new TaskUpdateParameters() - .withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withStatus(TaskStatus.ENABLED) - .withAgentConfiguration(new AgentProperties().withCpu(3)) - .withStep(new DockerBuildStepUpdateParameters().withImageNames(Arrays.asList("azurerest:testtag1")) - .withDockerFilePath("src/DockerFile")) - .withTrigger( - new TriggerUpdateParameters().withSourceTriggers(Arrays.asList(new SourceTriggerUpdateParameters() - .withSourceRepository(new SourceUpdateParameters() - .withSourceControlAuthProperties(new AuthInfoUpdateParameters().withTokenType(TokenType.PAT) - .withToken("fakeTokenPlaceholder"))) - .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) - .withName("mySourceTrigger")))) - .withCredentials(new Credentials().withCustomRegistries( - mapOf("myregistry.azurecr.io", new CustomRegistryCredentials().withIdentity("[system]")))), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/ManagedIdentity/TasksUpdate_WithKeyVaultCustomCredentials.json - */ - /** - * Sample code: Tasks_Update_WithKeyVaultCustomCredentials. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksUpdateWithKeyVaultCustomCredentials(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .update("myResourceGroup", "myRegistry", "myTask", new TaskUpdateParameters() - .withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withStatus(TaskStatus.ENABLED) - .withAgentConfiguration(new AgentProperties().withCpu(3)) - .withStep(new DockerBuildStepUpdateParameters().withImageNames(Arrays.asList("azurerest:testtag1")) - .withDockerFilePath("src/DockerFile")) - .withTrigger( - new TriggerUpdateParameters().withSourceTriggers(Arrays.asList(new SourceTriggerUpdateParameters() - .withSourceRepository(new SourceUpdateParameters() - .withSourceControlAuthProperties(new AuthInfoUpdateParameters().withTokenType(TokenType.PAT) - .withToken("fakeTokenPlaceholder"))) - .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) - .withName("mySourceTrigger")))) - .withCredentials(new Credentials().withCustomRegistries(mapOf("myregistry.azurecr.io", - new CustomRegistryCredentials() - .withUsername( - new SecretObject().withValue("https://myacbvault.vault.azure.net/secrets/username") - .withType(SecretObjectType.VAULTSECRET)) - .withPassword( - new SecretObject().withValue("https://myacbvault.vault.azure.net/secrets/password") - .withType(SecretObjectType.VAULTSECRET)) - .withIdentity("[system]")))), - com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TasksUpdate.json - */ - /** - * Sample code: Tasks_Update. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksUpdate(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .update("myResourceGroup", "myRegistry", "myTask", new TaskUpdateParameters() - .withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withStatus(TaskStatus.ENABLED) - .withAgentConfiguration(new AgentProperties().withCpu(3)) - .withStep(new DockerBuildStepUpdateParameters().withImageNames(Arrays.asList("azurerest:testtag1")) - .withDockerFilePath("src/DockerFile")) - .withTrigger( - new TriggerUpdateParameters().withSourceTriggers(Arrays.asList(new SourceTriggerUpdateParameters() - .withSourceRepository(new SourceUpdateParameters() - .withSourceControlAuthProperties(new AuthInfoUpdateParameters().withTokenType(TokenType.PAT) - .withToken("fakeTokenPlaceholder"))) - .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) - .withName("mySourceTrigger")))) - .withCredentials(new Credentials().withCustomRegistries(mapOf("myregistry.azurecr.io", - new CustomRegistryCredentials() - .withUsername(new SecretObject().withValue("username").withType(SecretObjectType.OPAQUE)) - .withPassword( - new SecretObject().withValue("https://myacbvault.vault.azure.net/secrets/password") - .withType(SecretObjectType.VAULTSECRET)) - .withIdentity("[system]")))) - .withLogTemplate("acr/tasks:{{.Run.OS}}"), com.azure.core.util.Context.NONE); - } - - /* - * x-ms-original-file: - * specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/RegistryTasks/preview/2019-06-01- - * preview/examples/TasksUpdate_WithOpaqueCustomCredentials.json - */ - /** - * Sample code: Tasks_Update_WithOpaqueCustomCredentials. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void tasksUpdateWithOpaqueCustomCredentials(com.azure.resourcemanager.AzureResourceManager azure) { - azure.containerRegistries() - .manager() - .serviceClient() - .getTasks() - .update("myResourceGroup", "myRegistry", "myTask", new TaskUpdateParameters() - .withTags(mapOf("testkey", "fakeTokenPlaceholder")) - .withStatus(TaskStatus.ENABLED) - .withAgentConfiguration(new AgentProperties().withCpu(3)) - .withStep(new DockerBuildStepUpdateParameters().withImageNames(Arrays.asList("azurerest:testtag1")) - .withDockerFilePath("src/DockerFile")) - .withTrigger( - new TriggerUpdateParameters().withSourceTriggers(Arrays.asList(new SourceTriggerUpdateParameters() - .withSourceRepository(new SourceUpdateParameters() - .withSourceControlAuthProperties(new AuthInfoUpdateParameters().withTokenType(TokenType.PAT) - .withToken("fakeTokenPlaceholder"))) - .withSourceTriggerEvents(Arrays.asList(SourceTriggerEvent.COMMIT)) - .withName("mySourceTrigger")))) - .withCredentials(new Credentials().withCustomRegistries(mapOf("myregistry.azurecr.io", - new CustomRegistryCredentials() - .withUsername(new SecretObject().withValue("username").withType(SecretObjectType.OPAQUE)) - .withPassword(new SecretObject().withValue("***").withType(SecretObjectType.OPAQUE))))), - 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/servicelinker/azure-resourcemanager-servicelinker/pom.xml b/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml index 5c911bac3db3..240ff5d680b9 100644 --- a/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml +++ b/sdk/servicelinker/azure-resourcemanager-servicelinker/pom.xml @@ -73,7 +73,7 @@ com.azure.resourcemanager azure-resourcemanager - 2.57.0 + 2.58.0 test diff --git a/sdk/spring/CHANGELOG.md b/sdk/spring/CHANGELOG.md index 3a65e0f34f4d..c7bd70f320bb 100644 --- a/sdk/spring/CHANGELOG.md +++ b/sdk/spring/CHANGELOG.md @@ -1,5 +1,22 @@ # Release History +## 6.2.0-beta.1 (Unreleased) +Upgrade Spring Boot dependencies version to 3.5.9 and Spring Cloud dependencies version to 2025.0.1 + +### Spring Cloud Azure Autoconfigure +This section includes changes in `spring-cloud-azure-autoconfigure` module. + +#### Bugs Fixed + +- Fix `ClassNotFoundException: com.nimbusds.oauth2.sdk.util.StringUtils` in Active Directory starter. ([#47600](https://github.com/Azure/azure-sdk-for-java/issues/47600)) + +### Spring Cloud Azure Appconfiguration Config +This section includes changes in `spring-cloud-azure-appconfiguration-config` module. + +#### Bugs Fixed + +- Fixed bug where connection string validation occurred even when `spring.cloud.azure.appconfiguration.enabled` is `false`. ([#47587](https://github.com/Azure/azure-sdk-for-java/issues/47587)) + ## 6.1.0 (2025-12-16) - This release is compatible with Spring Boot 3.5.0-3.5.8. (Note: 3.5.x (x>8) should be supported, but they aren't tested with this release.) - This release is compatible with Spring Cloud 2025.0.0. (Note: 2025.0.x (x>0) should be supported, but they aren't tested with this release.) diff --git a/sdk/spring/azure-spring-data-cosmos/README.md b/sdk/spring/azure-spring-data-cosmos/README.md index bffdf144499d..93b76bb4075d 100644 --- a/sdk/spring/azure-spring-data-cosmos/README.md +++ b/sdk/spring/azure-spring-data-cosmos/README.md @@ -280,8 +280,8 @@ java -javaagent:"" -jar #### Using database provisioned throughput -Cosmos supports both [container](https://learn.microsoft.com/azure/cosmos-db/sql/how-to-provision-container-throughput) -and [database](https://learn.microsoft.com/azure/cosmos-db/sql/how-to-provision-database-throughput) provisioned +Cosmos supports both [container](https://learn.microsoft.com/azure/cosmos-db/how-to-provision-container-throughput) +and [database](https://learn.microsoft.com/azure/cosmos-db/how-to-provision-database-throughput) provisioned throughput. By default, spring-data-cosmos will provision throughput for each container created. If you prefer to share throughput between containers, you can enable database provisioned throughput via CosmosConfig. @@ -608,7 +608,7 @@ public class MyItem { String _etag; } ``` -- Read more about Optimistic Locking [here](https://learn.microsoft.com/azure/cosmos-db/sql/database-transactions-optimistic-concurrency#optimistic-concurrency-control) +- Read more about Optimistic Locking [here](https://learn.microsoft.com/azure/cosmos-db/database-transactions-optimistic-concurrency#optimistic-concurrency-control) ### Spring Data custom query, pageable and sorting - Azure-spring-data-cosmos supports [spring data custom queries][spring_data_custom_query] diff --git a/sdk/spring/azure-spring-data-cosmos/pom.xml b/sdk/spring/azure-spring-data-cosmos/pom.xml index 0b061eff639a..6ebb1bb437b2 100644 --- a/sdk/spring/azure-spring-data-cosmos/pom.xml +++ b/sdk/spring/azure-spring-data-cosmos/pom.xml @@ -53,7 +53,7 @@ org.springframework spring-core - 6.2.10 + 6.2.15 commons-logging @@ -64,27 +64,27 @@ org.springframework spring-web - 6.2.10 + 6.2.15 org.springframework spring-beans - 6.2.10 + 6.2.15 org.springframework spring-context - 6.2.10 + 6.2.15 org.springframework spring-tx - 6.2.10 + 6.2.15 org.springframework.data spring-data-commons - 3.5.3 + 3.5.7 org.slf4j @@ -95,7 +95,7 @@ org.springframework spring-expression - 6.2.10 + 6.2.15 com.azure @@ -105,17 +105,17 @@ com.fasterxml.jackson.module jackson-module-parameter-names - 2.19.2 + 2.19.4 com.fasterxml.jackson.datatype jackson-datatype-jdk8 - 2.19.2 + 2.19.4 com.fasterxml.jackson.core jackson-annotations - 2.19.2 + 2.19.4 org.javatuples @@ -145,19 +145,19 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -169,7 +169,7 @@ io.projectreactor reactor-test - 3.7.9 + 3.7.14 test @@ -203,7 +203,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -255,17 +255,17 @@ - org.springframework:spring-beans:[6.2.10] - org.springframework:spring-web:[6.2.10] - org.springframework:spring-tx:[6.2.10] - org.springframework:spring-expression:[6.2.10] - org.springframework:spring-core:[6.2.10] - org.springframework:spring-context:[6.2.10] - org.springframework.data:spring-data-commons:[3.5.3] + org.springframework:spring-beans:[6.2.15] + org.springframework:spring-web:[6.2.15] + org.springframework:spring-tx:[6.2.15] + org.springframework:spring-expression:[6.2.15] + org.springframework:spring-core:[6.2.15] + org.springframework:spring-context:[6.2.15] + org.springframework.data:spring-data-commons:[3.5.7] org.javatuples:javatuples:[1.2] - com.fasterxml.jackson.core:jackson-annotations:[2.19.2] - com.fasterxml.jackson.datatype:jackson-datatype-jdk8:[2.19.2] - com.fasterxml.jackson.module:jackson-module-parameter-names:[2.19.2] + com.fasterxml.jackson.core:jackson-annotations:[2.19.4] + com.fasterxml.jackson.datatype:jackson-datatype-jdk8:[2.19.4] + com.fasterxml.jackson.module:jackson-module-parameter-names:[2.19.4] javax.annotation:javax.annotation-api:[1.3.2] org.apache.commons:commons-lang3:[3.17.0] org.slf4j:slf4j-api:[2.0.17] @@ -296,7 +296,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.5.3 + 3.5.4 src/test/resources/application.properties ${skip.integration.tests} @@ -330,7 +330,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.3 + 3.5.4 @@ -351,7 +351,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.5.3 + 3.5.4 @@ -371,7 +371,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.5.3 + 3.5.4 diff --git a/sdk/spring/scripts/spring_boot_3.5.5_managed_external_dependencies.txt b/sdk/spring/scripts/spring_boot_3.5.9_managed_external_dependencies.txt similarity index 51% rename from sdk/spring/scripts/spring_boot_3.5.5_managed_external_dependencies.txt rename to sdk/spring/scripts/spring_boot_3.5.9_managed_external_dependencies.txt index 4ba839f64a4a..e44aef3fd2e1 100644 --- a/sdk/spring/scripts/spring_boot_3.5.5_managed_external_dependencies.txt +++ b/sdk/spring/scripts/spring_boot_3.5.9_managed_external_dependencies.txt @@ -1,99 +1,99 @@ -ch.qos.logback:logback-classic;1.5.18 -ch.qos.logback:logback-core;1.5.18 -co.elastic.clients:elasticsearch-java;8.18.5 +ch.qos.logback:logback-classic;1.5.22 +ch.qos.logback:logback-core;1.5.22 +co.elastic.clients:elasticsearch-java;8.18.8 com.couchbase.client:java-client;3.8.3 -com.datastax.oss:native-protocol;1.5.1 +com.datastax.oss:native-protocol;1.5.2 com.ecwid.consul:consul-api;1.4.5 -com.fasterxml.jackson.core:jackson-annotations;2.19.2 -com.fasterxml.jackson.core:jackson-core;2.19.2 -com.fasterxml.jackson.core:jackson-databind;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-avro;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-cbor;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-csv;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-ion;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-properties;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-protobuf;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-smile;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-toml;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-xml;2.19.2 -com.fasterxml.jackson.dataformat:jackson-dataformat-yaml;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-eclipse-collections;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-guava;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-hibernate4;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-hibernate5;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-hibernate5-jakarta;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-hibernate6;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-hppc;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-jakarta-jsonp;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-javax-money;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-jaxrs;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-jdk8;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-joda;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-joda-money;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-json-org;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-jsr310;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-jsr353;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-moneta;2.19.2 -com.fasterxml.jackson.datatype:jackson-datatype-pcollections;2.19.2 -com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-base;2.19.2 -com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-cbor-provider;2.19.2 -com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider;2.19.2 -com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-smile-provider;2.19.2 -com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-xml-provider;2.19.2 -com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-yaml-provider;2.19.2 -com.fasterxml.jackson.jaxrs:jackson-jaxrs-base;2.19.2 -com.fasterxml.jackson.jaxrs:jackson-jaxrs-cbor-provider;2.19.2 -com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider;2.19.2 -com.fasterxml.jackson.jaxrs:jackson-jaxrs-smile-provider;2.19.2 -com.fasterxml.jackson.jaxrs:jackson-jaxrs-xml-provider;2.19.2 -com.fasterxml.jackson.jaxrs:jackson-jaxrs-yaml-provider;2.19.2 -com.fasterxml.jackson.jr:jackson-jr-all;2.19.2 -com.fasterxml.jackson.jr:jackson-jr-annotation-support;2.19.2 -com.fasterxml.jackson.jr:jackson-jr-extension-javatime;2.19.2 -com.fasterxml.jackson.jr:jackson-jr-objects;2.19.2 -com.fasterxml.jackson.jr:jackson-jr-retrofit2;2.19.2 -com.fasterxml.jackson.jr:jackson-jr-stree;2.19.2 -com.fasterxml.jackson.module:jackson-module-afterburner;2.19.2 -com.fasterxml.jackson.module:jackson-module-android-record;2.19.2 -com.fasterxml.jackson.module:jackson-module-blackbird;2.19.2 -com.fasterxml.jackson.module:jackson-module-guice;2.19.2 -com.fasterxml.jackson.module:jackson-module-guice7;2.19.2 -com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations;2.19.2 -com.fasterxml.jackson.module:jackson-module-jaxb-annotations;2.19.2 -com.fasterxml.jackson.module:jackson-module-jsonSchema;2.19.2 -com.fasterxml.jackson.module:jackson-module-jsonSchema-jakarta;2.19.2 -com.fasterxml.jackson.module:jackson-module-kotlin;2.19.2 -com.fasterxml.jackson.module:jackson-module-mrbean;2.19.2 -com.fasterxml.jackson.module:jackson-module-no-ctor-deser;2.19.2 -com.fasterxml.jackson.module:jackson-module-osgi;2.19.2 -com.fasterxml.jackson.module:jackson-module-parameter-names;2.19.2 -com.fasterxml.jackson.module:jackson-module-paranamer;2.19.2 -com.fasterxml.jackson.module:jackson-module-scala_2.11;2.19.2 -com.fasterxml.jackson.module:jackson-module-scala_2.12;2.19.2 -com.fasterxml.jackson.module:jackson-module-scala_2.13;2.19.2 -com.fasterxml.jackson.module:jackson-module-scala_3;2.19.2 -com.fasterxml.jackson:jackson-bom;2.19.2 -com.fasterxml:classmate;1.7.0 -com.github.ben-manes.caffeine:caffeine;3.2.2 -com.github.ben-manes.caffeine:guava;3.2.2 -com.github.ben-manes.caffeine:jcache;3.2.2 -com.github.ben-manes.caffeine:simulator;3.2.2 +com.fasterxml.jackson.core:jackson-annotations;2.19.4 +com.fasterxml.jackson.core:jackson-core;2.19.4 +com.fasterxml.jackson.core:jackson-databind;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-avro;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-cbor;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-csv;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-ion;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-properties;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-protobuf;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-smile;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-toml;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-xml;2.19.4 +com.fasterxml.jackson.dataformat:jackson-dataformat-yaml;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-eclipse-collections;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-guava;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-hibernate4;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-hibernate5;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-hibernate5-jakarta;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-hibernate6;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-hppc;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-jakarta-jsonp;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-javax-money;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-jaxrs;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-jdk8;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-joda;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-joda-money;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-json-org;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-jsr310;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-jsr353;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-moneta;2.19.4 +com.fasterxml.jackson.datatype:jackson-datatype-pcollections;2.19.4 +com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-base;2.19.4 +com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-cbor-provider;2.19.4 +com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-json-provider;2.19.4 +com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-smile-provider;2.19.4 +com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-xml-provider;2.19.4 +com.fasterxml.jackson.jakarta.rs:jackson-jakarta-rs-yaml-provider;2.19.4 +com.fasterxml.jackson.jaxrs:jackson-jaxrs-base;2.19.4 +com.fasterxml.jackson.jaxrs:jackson-jaxrs-cbor-provider;2.19.4 +com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider;2.19.4 +com.fasterxml.jackson.jaxrs:jackson-jaxrs-smile-provider;2.19.4 +com.fasterxml.jackson.jaxrs:jackson-jaxrs-xml-provider;2.19.4 +com.fasterxml.jackson.jaxrs:jackson-jaxrs-yaml-provider;2.19.4 +com.fasterxml.jackson.jr:jackson-jr-all;2.19.4 +com.fasterxml.jackson.jr:jackson-jr-annotation-support;2.19.4 +com.fasterxml.jackson.jr:jackson-jr-extension-javatime;2.19.4 +com.fasterxml.jackson.jr:jackson-jr-objects;2.19.4 +com.fasterxml.jackson.jr:jackson-jr-retrofit2;2.19.4 +com.fasterxml.jackson.jr:jackson-jr-stree;2.19.4 +com.fasterxml.jackson.module:jackson-module-afterburner;2.19.4 +com.fasterxml.jackson.module:jackson-module-android-record;2.19.4 +com.fasterxml.jackson.module:jackson-module-blackbird;2.19.4 +com.fasterxml.jackson.module:jackson-module-guice;2.19.4 +com.fasterxml.jackson.module:jackson-module-guice7;2.19.4 +com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations;2.19.4 +com.fasterxml.jackson.module:jackson-module-jaxb-annotations;2.19.4 +com.fasterxml.jackson.module:jackson-module-jsonSchema;2.19.4 +com.fasterxml.jackson.module:jackson-module-jsonSchema-jakarta;2.19.4 +com.fasterxml.jackson.module:jackson-module-kotlin;2.19.4 +com.fasterxml.jackson.module:jackson-module-mrbean;2.19.4 +com.fasterxml.jackson.module:jackson-module-no-ctor-deser;2.19.4 +com.fasterxml.jackson.module:jackson-module-osgi;2.19.4 +com.fasterxml.jackson.module:jackson-module-parameter-names;2.19.4 +com.fasterxml.jackson.module:jackson-module-paranamer;2.19.4 +com.fasterxml.jackson.module:jackson-module-scala_2.11;2.19.4 +com.fasterxml.jackson.module:jackson-module-scala_2.12;2.19.4 +com.fasterxml.jackson.module:jackson-module-scala_2.13;2.19.4 +com.fasterxml.jackson.module:jackson-module-scala_3;2.19.4 +com.fasterxml.jackson:jackson-bom;2.19.4 +com.fasterxml:classmate;1.7.1 +com.github.ben-manes.caffeine:caffeine;3.2.3 +com.github.ben-manes.caffeine:guava;3.2.3 +com.github.ben-manes.caffeine:jcache;3.2.3 +com.github.ben-manes.caffeine:simulator;3.2.3 com.github.mxab.thymeleaf.extras:thymeleaf-extras-data-attribute;2.0.1 -com.github.tomakehurst:wiremock-jre8-standalone;2.35.1 -com.google.code.gson:gson;2.13.1 -com.graphql-java:graphql-java;24.1 +com.github.tomakehurst:wiremock-jre8-standalone;2.35.2 +com.google.code.gson:gson;2.13.2 +com.graphql-java:graphql-java;24.3 com.h2database:h2;2.3.232 com.hazelcast:hazelcast;5.5.0 com.hazelcast:hazelcast-spring;5.5.0 -com.ibm.db2:jcc;12.1.2.0 +com.ibm.db2:jcc;12.1.3.0 com.jayway.jsonpath:json-path;2.9.0 com.jayway.jsonpath:json-path-assert;2.9.0 -com.microsoft.sqlserver:mssql-jdbc;12.10.1.jre11 -com.mysql:mysql-connector-j;9.4.0 -com.netflix.eureka:eureka-client;2.0.4 -com.netflix.eureka:eureka-client-jersey3;2.0.4 -com.netflix.eureka:eureka-core;2.0.4 -com.netflix.eureka:eureka-core-jersey3;2.0.4 +com.microsoft.sqlserver:mssql-jdbc;12.10.2.jre11 +com.mysql:mysql-connector-j;9.5.0 +com.netflix.eureka:eureka-client;2.0.5 +com.netflix.eureka:eureka-client-jersey3;2.0.5 +com.netflix.eureka:eureka-core;2.0.5 +com.netflix.eureka:eureka-core-jersey3;2.0.5 com.oracle.database.ha:ons;23.7.0.25.01 com.oracle.database.ha:simplefan;23.7.0.25.01 com.oracle.database.jdbc:ojdbc11;23.7.0.25.01 @@ -150,17 +150,17 @@ com.squareup.okhttp3:okhttp-sse;4.12.0 com.squareup.okhttp3:okhttp-tls;4.12.0 com.squareup.okhttp3:okhttp-urlconnection;4.12.0 com.sun.istack:istack-commons-runtime;4.1.2 -com.sun.xml.bind:jaxb-core;4.0.5 -com.sun.xml.bind:jaxb-impl;4.0.5 -com.sun.xml.bind:jaxb-jxc;4.0.5 -com.sun.xml.bind:jaxb-osgi;4.0.5 -com.sun.xml.bind:jaxb-xjc;4.0.5 +com.sun.xml.bind:jaxb-core;4.0.6 +com.sun.xml.bind:jaxb-impl;4.0.6 +com.sun.xml.bind:jaxb-jxc;4.0.6 +com.sun.xml.bind:jaxb-osgi;4.0.6 +com.sun.xml.bind:jaxb-xjc;4.0.6 com.sun.xml.fastinfoset:FastInfoset;2.1.1 com.sun.xml.messaging.saaj:saaj-impl;3.0.4 com.toomuchcoding.jsonassert:jsonassert;0.8.0 com.toomuchcoding.jsonassert:jsonassert-shade;0.8.0 -com.unboundid:unboundid-ldapsdk;7.0.3 -com.zaxxer:HikariCP;6.3.2 +com.unboundid:unboundid-ldapsdk;7.0.4 +com.zaxxer:HikariCP;6.3.3 commons-codec:commons-codec;1.18.0 commons-pool:commons-pool;1.6 io.asyncer:r2dbc-mysql;1.4.1 @@ -322,89 +322,89 @@ io.github.resilience4j:resilience4j-spring-cloud2;2.2.0 io.github.resilience4j:resilience4j-spring6;2.2.0 io.github.resilience4j:resilience4j-timelimiter;2.2.0 io.github.resilience4j:resilience4j-vavr;2.2.0 -io.kubernetes:client-java;19.0.2 -io.kubernetes:client-java-extended;19.0.2 -io.kubernetes:client-java-spring-integration;19.0.2 +io.kubernetes:client-java;19.0.3 +io.kubernetes:client-java-extended;19.0.3 +io.kubernetes:client-java-spring-integration;19.0.3 io.lettuce:lettuce-core;6.6.0.RELEASE io.micrometer:context-propagation;1.1.3 -io.micrometer:docs;1.5.3 -io.micrometer:micrometer-bom;1.15.3 -io.micrometer:micrometer-commons;1.15.3 -io.micrometer:micrometer-core;1.15.3 -io.micrometer:micrometer-jakarta9;1.15.3 -io.micrometer:micrometer-java11;1.15.3 -io.micrometer:micrometer-java21;1.15.3 -io.micrometer:micrometer-jetty11;1.15.3 -io.micrometer:micrometer-jetty12;1.15.3 -io.micrometer:micrometer-observation;1.15.3 -io.micrometer:micrometer-observation-test;1.15.3 -io.micrometer:micrometer-registry-appoptics;1.15.3 -io.micrometer:micrometer-registry-atlas;1.15.3 -io.micrometer:micrometer-registry-azure-monitor;1.15.3 -io.micrometer:micrometer-registry-cloudwatch2;1.15.3 -io.micrometer:micrometer-registry-datadog;1.15.3 -io.micrometer:micrometer-registry-dynatrace;1.15.3 -io.micrometer:micrometer-registry-elastic;1.15.3 -io.micrometer:micrometer-registry-ganglia;1.15.3 -io.micrometer:micrometer-registry-graphite;1.15.3 -io.micrometer:micrometer-registry-health;1.15.3 -io.micrometer:micrometer-registry-humio;1.15.3 -io.micrometer:micrometer-registry-influx;1.15.3 -io.micrometer:micrometer-registry-jmx;1.15.3 -io.micrometer:micrometer-registry-kairos;1.15.3 -io.micrometer:micrometer-registry-new-relic;1.15.3 -io.micrometer:micrometer-registry-opentsdb;1.15.3 -io.micrometer:micrometer-registry-otlp;1.15.3 -io.micrometer:micrometer-registry-prometheus;1.15.3 -io.micrometer:micrometer-registry-prometheus-simpleclient;1.15.3 -io.micrometer:micrometer-registry-signalfx;1.15.3 -io.micrometer:micrometer-registry-stackdriver;1.15.3 -io.micrometer:micrometer-registry-statsd;1.15.3 -io.micrometer:micrometer-registry-wavefront;1.15.3 -io.micrometer:micrometer-test;1.15.3 -io.micrometer:micrometer-tracing;1.5.3 -io.micrometer:micrometer-tracing-bom;1.5.3 -io.micrometer:micrometer-tracing-bridge-brave;1.5.3 -io.micrometer:micrometer-tracing-bridge-otel;1.5.3 -io.micrometer:micrometer-tracing-integration-test;1.5.3 -io.micrometer:micrometer-tracing-reporter-wavefront;1.5.3 -io.micrometer:micrometer-tracing-test;1.5.3 -io.netty:netty-all;4.1.124.Final -io.netty:netty-bom;4.1.124.Final -io.netty:netty-buffer;4.1.124.Final -io.netty:netty-codec;4.1.124.Final -io.netty:netty-codec-dns;4.1.124.Final -io.netty:netty-codec-haproxy;4.1.124.Final -io.netty:netty-codec-http;4.1.124.Final -io.netty:netty-codec-http2;4.1.124.Final -io.netty:netty-codec-memcache;4.1.124.Final -io.netty:netty-codec-mqtt;4.1.124.Final -io.netty:netty-codec-redis;4.1.124.Final -io.netty:netty-codec-smtp;4.1.124.Final -io.netty:netty-codec-socks;4.1.124.Final -io.netty:netty-codec-stomp;4.1.124.Final -io.netty:netty-codec-xml;4.1.124.Final -io.netty:netty-common;4.1.124.Final -io.netty:netty-dev-tools;4.1.124.Final -io.netty:netty-handler;4.1.124.Final -io.netty:netty-handler-proxy;4.1.124.Final -io.netty:netty-handler-ssl-ocsp;4.1.124.Final -io.netty:netty-resolver;4.1.124.Final -io.netty:netty-resolver-dns;4.1.124.Final -io.netty:netty-resolver-dns-classes-macos;4.1.124.Final -io.netty:netty-resolver-dns-native-macos;4.1.124.Final -io.netty:netty-tcnative;2.0.72.Final -io.netty:netty-tcnative-boringssl-static;2.0.72.Final -io.netty:netty-tcnative-classes;2.0.72.Final -io.netty:netty-transport;4.1.124.Final -io.netty:netty-transport-classes-epoll;4.1.124.Final -io.netty:netty-transport-classes-kqueue;4.1.124.Final -io.netty:netty-transport-native-epoll;4.1.124.Final -io.netty:netty-transport-native-kqueue;4.1.124.Final -io.netty:netty-transport-native-unix-common;4.1.124.Final -io.netty:netty-transport-rxtx;4.1.124.Final -io.netty:netty-transport-sctp;4.1.124.Final -io.netty:netty-transport-udt;4.1.124.Final +io.micrometer:docs;1.5.7 +io.micrometer:micrometer-bom;1.15.7 +io.micrometer:micrometer-commons;1.15.7 +io.micrometer:micrometer-core;1.15.7 +io.micrometer:micrometer-jakarta9;1.15.7 +io.micrometer:micrometer-java11;1.15.7 +io.micrometer:micrometer-java21;1.15.7 +io.micrometer:micrometer-jetty11;1.15.7 +io.micrometer:micrometer-jetty12;1.15.7 +io.micrometer:micrometer-observation;1.15.7 +io.micrometer:micrometer-observation-test;1.15.7 +io.micrometer:micrometer-registry-appoptics;1.15.7 +io.micrometer:micrometer-registry-atlas;1.15.7 +io.micrometer:micrometer-registry-azure-monitor;1.15.7 +io.micrometer:micrometer-registry-cloudwatch2;1.15.7 +io.micrometer:micrometer-registry-datadog;1.15.7 +io.micrometer:micrometer-registry-dynatrace;1.15.7 +io.micrometer:micrometer-registry-elastic;1.15.7 +io.micrometer:micrometer-registry-ganglia;1.15.7 +io.micrometer:micrometer-registry-graphite;1.15.7 +io.micrometer:micrometer-registry-health;1.15.7 +io.micrometer:micrometer-registry-humio;1.15.7 +io.micrometer:micrometer-registry-influx;1.15.7 +io.micrometer:micrometer-registry-jmx;1.15.7 +io.micrometer:micrometer-registry-kairos;1.15.7 +io.micrometer:micrometer-registry-new-relic;1.15.7 +io.micrometer:micrometer-registry-opentsdb;1.15.7 +io.micrometer:micrometer-registry-otlp;1.15.7 +io.micrometer:micrometer-registry-prometheus;1.15.7 +io.micrometer:micrometer-registry-prometheus-simpleclient;1.15.7 +io.micrometer:micrometer-registry-signalfx;1.15.7 +io.micrometer:micrometer-registry-stackdriver;1.15.7 +io.micrometer:micrometer-registry-statsd;1.15.7 +io.micrometer:micrometer-registry-wavefront;1.15.7 +io.micrometer:micrometer-test;1.15.7 +io.micrometer:micrometer-tracing;1.5.7 +io.micrometer:micrometer-tracing-bom;1.5.7 +io.micrometer:micrometer-tracing-bridge-brave;1.5.7 +io.micrometer:micrometer-tracing-bridge-otel;1.5.7 +io.micrometer:micrometer-tracing-integration-test;1.5.7 +io.micrometer:micrometer-tracing-reporter-wavefront;1.5.7 +io.micrometer:micrometer-tracing-test;1.5.7 +io.netty:netty-all;4.1.130.Final +io.netty:netty-bom;4.1.130.Final +io.netty:netty-buffer;4.1.130.Final +io.netty:netty-codec;4.1.130.Final +io.netty:netty-codec-dns;4.1.130.Final +io.netty:netty-codec-haproxy;4.1.130.Final +io.netty:netty-codec-http;4.1.130.Final +io.netty:netty-codec-http2;4.1.130.Final +io.netty:netty-codec-memcache;4.1.130.Final +io.netty:netty-codec-mqtt;4.1.130.Final +io.netty:netty-codec-redis;4.1.130.Final +io.netty:netty-codec-smtp;4.1.130.Final +io.netty:netty-codec-socks;4.1.130.Final +io.netty:netty-codec-stomp;4.1.130.Final +io.netty:netty-codec-xml;4.1.130.Final +io.netty:netty-common;4.1.130.Final +io.netty:netty-dev-tools;4.1.130.Final +io.netty:netty-handler;4.1.130.Final +io.netty:netty-handler-proxy;4.1.130.Final +io.netty:netty-handler-ssl-ocsp;4.1.130.Final +io.netty:netty-resolver;4.1.130.Final +io.netty:netty-resolver-dns;4.1.130.Final +io.netty:netty-resolver-dns-classes-macos;4.1.130.Final +io.netty:netty-resolver-dns-native-macos;4.1.130.Final +io.netty:netty-tcnative;2.0.74.Final +io.netty:netty-tcnative-boringssl-static;2.0.74.Final +io.netty:netty-tcnative-classes;2.0.74.Final +io.netty:netty-transport;4.1.130.Final +io.netty:netty-transport-classes-epoll;4.1.130.Final +io.netty:netty-transport-classes-kqueue;4.1.130.Final +io.netty:netty-transport-native-epoll;4.1.130.Final +io.netty:netty-transport-native-kqueue;4.1.130.Final +io.netty:netty-transport-native-unix-common;4.1.130.Final +io.netty:netty-transport-rxtx;4.1.130.Final +io.netty:netty-transport-sctp;4.1.130.Final +io.netty:netty-transport-udt;4.1.130.Final io.opentelemetry:opentelemetry-api;1.49.0 io.opentelemetry:opentelemetry-bom;1.49.0 io.opentelemetry:opentelemetry-context;1.49.0 @@ -429,21 +429,21 @@ io.opentelemetry:opentelemetry-sdk-logs;1.49.0 io.opentelemetry:opentelemetry-sdk-metrics;1.49.0 io.opentelemetry:opentelemetry-sdk-testing;1.49.0 io.opentelemetry:opentelemetry-sdk-trace;1.49.0 -io.projectreactor.addons:reactor-adapter;3.5.2 -io.projectreactor.addons:reactor-extra;3.5.2 -io.projectreactor.addons:reactor-pool;1.1.3 -io.projectreactor.addons:reactor-pool-micrometer;0.2.3 -io.projectreactor.kafka:reactor-kafka;1.3.23 -io.projectreactor.kotlin:reactor-kotlin-extensions;1.2.3 -io.projectreactor.netty:reactor-netty;1.2.9 -io.projectreactor.netty:reactor-netty-core;1.2.9 -io.projectreactor.netty:reactor-netty-http;1.2.9 -io.projectreactor.netty:reactor-netty-http-brave;1.2.9 -io.projectreactor:reactor-bom;2024.0.9 -io.projectreactor:reactor-core;3.7.9 -io.projectreactor:reactor-core-micrometer;1.2.9 -io.projectreactor:reactor-test;3.7.9 -io.projectreactor:reactor-tools;3.7.9 +io.projectreactor.addons:reactor-adapter;3.5.4 +io.projectreactor.addons:reactor-extra;3.5.4 +io.projectreactor.addons:reactor-pool;1.1.7 +io.projectreactor.addons:reactor-pool-micrometer;0.2.7 +io.projectreactor.kafka:reactor-kafka;1.3.25 +io.projectreactor.kotlin:reactor-kotlin-extensions;1.2.5 +io.projectreactor.netty:reactor-netty;1.2.13 +io.projectreactor.netty:reactor-netty-core;1.2.13 +io.projectreactor.netty:reactor-netty-http;1.2.13 +io.projectreactor.netty:reactor-netty-http-brave;1.2.13 +io.projectreactor:reactor-bom;2024.0.13 +io.projectreactor:reactor-core;3.7.14 +io.projectreactor:reactor-core-micrometer;1.2.14 +io.projectreactor:reactor-test;3.7.14 +io.projectreactor:reactor-tools;3.7.14 io.prometheus:prometheus-metrics-bom;1.3.10 io.prometheus:prometheus-metrics-config;1.3.10 io.prometheus:prometheus-metrics-core;1.3.10 @@ -494,12 +494,12 @@ io.prometheus:simpleclient_tracer_common;0.16.0 io.prometheus:simpleclient_tracer_otel;0.16.0 io.prometheus:simpleclient_tracer_otel_agent;0.16.0 io.prometheus:simpleclient_vertx;0.16.0 -io.r2dbc:r2dbc-h2;1.0.0.RELEASE -io.r2dbc:r2dbc-mssql;1.0.2.RELEASE +io.r2dbc:r2dbc-h2;1.0.1.RELEASE +io.r2dbc:r2dbc-mssql;1.0.3.RELEASE io.r2dbc:r2dbc-pool;1.0.2.RELEASE io.r2dbc:r2dbc-proxy;1.1.6.RELEASE io.r2dbc:r2dbc-spi;1.0.0.RELEASE -io.reactivex.rxjava3:rxjava;3.1.11 +io.reactivex.rxjava3:rxjava;3.1.12 io.rest-assured:json-path;5.5.6 io.rest-assured:json-schema-validator;5.5.6 io.rest-assured:kotlin-extensions;5.5.6 @@ -523,9 +523,9 @@ io.rsocket:rsocket-test;1.1.5 io.rsocket:rsocket-transport-local;1.1.5 io.rsocket:rsocket-transport-netty;1.1.5 io.spring.gradle:dependency-management-plugin;1.1.7 -io.undertow:undertow-core;2.3.18.Final -io.undertow:undertow-servlet;2.3.18.Final -io.undertow:undertow-websockets-jsr;2.3.18.Final +io.undertow:undertow-core;2.3.20.Final +io.undertow:undertow-servlet;2.3.20.Final +io.undertow:undertow-websockets-jsr;2.3.20.Final io.zipkin.brave:brave;6.1.0 io.zipkin.brave:brave-bom;6.1.0 io.zipkin.brave:brave-context-jfr;6.1.0 @@ -576,13 +576,13 @@ io.zipkin.reporter2:zipkin-sender-libthrift;3.5.1 io.zipkin.reporter2:zipkin-sender-okhttp3;3.5.1 io.zipkin.reporter2:zipkin-sender-pulsar-client;3.5.1 io.zipkin.reporter2:zipkin-sender-urlconnection;3.5.1 -jakarta.activation:jakarta.activation-api;2.1.3 +jakarta.activation:jakarta.activation-api;2.1.4 jakarta.annotation:jakarta.annotation-api;2.1.1 jakarta.inject:jakarta.inject-api;2.0.1 jakarta.jms:jakarta.jms-api;3.1.0 jakarta.json.bind:jakarta.json.bind-api;3.0.1 jakarta.json:jakarta.json-api;2.1.3 -jakarta.mail:jakarta.mail-api;2.1.3 +jakarta.mail:jakarta.mail-api;2.1.5 jakarta.management.j2ee:jakarta.management.j2ee-api;1.1.4 jakarta.persistence:jakarta.persistence-api;3.1.0 jakarta.servlet.jsp.jstl:jakarta.servlet.jsp.jstl-api;3.0.2 @@ -592,49 +592,49 @@ jakarta.validation:jakarta.validation-api;3.0.2 jakarta.websocket:jakarta.websocket-api;2.1.1 jakarta.websocket:jakarta.websocket-client-api;2.1.1 jakarta.ws.rs:jakarta.ws.rs-api;3.1.0 -jakarta.xml.bind:jakarta.xml.bind-api;4.0.2 +jakarta.xml.bind:jakarta.xml.bind-api;4.0.4 jakarta.xml.soap:jakarta.xml.soap-api;3.0.2 jakarta.xml.ws:jakarta.xml.ws-api;4.0.2 javax.cache:cache-api;1.1.1 javax.money:money-api;1.1 jaxen:jaxen;2.0.0 junit:junit;4.13.2 -net.bytebuddy:byte-buddy;1.17.7 -net.bytebuddy:byte-buddy-agent;1.17.7 +net.bytebuddy:byte-buddy;1.17.8 +net.bytebuddy:byte-buddy-agent;1.17.8 net.minidev:json-smart;2.5.2 net.sourceforge.jtds:jtds;1.3.1 net.sourceforge.nekohtml:nekohtml;1.9.22 nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect;3.4.0 -org.apache.activemq:activemq-all;6.1.7 -org.apache.activemq:activemq-amqp;6.1.7 -org.apache.activemq:activemq-blueprint;6.1.7 -org.apache.activemq:activemq-bom;6.1.7 +org.apache.activemq:activemq-all;6.1.8 +org.apache.activemq:activemq-amqp;6.1.8 +org.apache.activemq:activemq-blueprint;6.1.8 +org.apache.activemq:activemq-bom;6.1.8 org.apache.activemq:activemq-branding;2.40.0 -org.apache.activemq:activemq-broker;6.1.7 -org.apache.activemq:activemq-client;6.1.7 -org.apache.activemq:activemq-console;6.1.7 -org.apache.activemq:activemq-http;6.1.7 -org.apache.activemq:activemq-jaas;6.1.7 -org.apache.activemq:activemq-jdbc-store;6.1.7 -org.apache.activemq:activemq-jms-pool;6.1.7 -org.apache.activemq:activemq-kahadb-store;6.1.7 -org.apache.activemq:activemq-karaf;6.1.7 -org.apache.activemq:activemq-log4j-appender;6.1.7 -org.apache.activemq:activemq-mqtt;6.1.7 -org.apache.activemq:activemq-openwire-generator;6.1.7 -org.apache.activemq:activemq-openwire-legacy;6.1.7 -org.apache.activemq:activemq-osgi;6.1.7 -org.apache.activemq:activemq-pool;6.1.7 -org.apache.activemq:activemq-ra;6.1.7 -org.apache.activemq:activemq-rar;6.1.7 -org.apache.activemq:activemq-run;6.1.7 -org.apache.activemq:activemq-runtime-config;6.1.7 -org.apache.activemq:activemq-shiro;6.1.7 -org.apache.activemq:activemq-spring;6.1.7 -org.apache.activemq:activemq-stomp;6.1.7 -org.apache.activemq:activemq-web;6.1.7 -org.apache.activemq:activemq-web-console;6.1.7 -org.apache.activemq:activemq-web-demo;6.1.7 +org.apache.activemq:activemq-broker;6.1.8 +org.apache.activemq:activemq-client;6.1.8 +org.apache.activemq:activemq-console;6.1.8 +org.apache.activemq:activemq-http;6.1.8 +org.apache.activemq:activemq-jaas;6.1.8 +org.apache.activemq:activemq-jdbc-store;6.1.8 +org.apache.activemq:activemq-jms-pool;6.1.8 +org.apache.activemq:activemq-kahadb-store;6.1.8 +org.apache.activemq:activemq-karaf;6.1.8 +org.apache.activemq:activemq-log4j-appender;6.1.8 +org.apache.activemq:activemq-mqtt;6.1.8 +org.apache.activemq:activemq-openwire-generator;6.1.8 +org.apache.activemq:activemq-openwire-legacy;6.1.8 +org.apache.activemq:activemq-osgi;6.1.8 +org.apache.activemq:activemq-pool;6.1.8 +org.apache.activemq:activemq-ra;6.1.8 +org.apache.activemq:activemq-rar;6.1.8 +org.apache.activemq:activemq-run;6.1.8 +org.apache.activemq:activemq-runtime-config;6.1.8 +org.apache.activemq:activemq-shiro;6.1.8 +org.apache.activemq:activemq-spring;6.1.8 +org.apache.activemq:activemq-stomp;6.1.8 +org.apache.activemq:activemq-web;6.1.8 +org.apache.activemq:activemq-web-console;6.1.8 +org.apache.activemq:activemq-web-demo;6.1.8 org.apache.activemq:artemis-amqp-protocol;2.40.0 org.apache.activemq:artemis-bom;2.40.0 org.apache.activemq:artemis-boot;2.40.0 @@ -674,16 +674,16 @@ org.apache.activemq:artemis-service-extensions;2.40.0 org.apache.activemq:artemis-stomp-protocol;2.40.0 org.apache.activemq:artemis-web;2.40.0 org.apache.activemq:artemis-website;2.40.0 -org.apache.cassandra:java-driver-bom;4.19.0 -org.apache.cassandra:java-driver-core;4.19.0 -org.apache.cassandra:java-driver-core-shaded;4.19.0 -org.apache.cassandra:java-driver-guava-shaded;4.19.0 -org.apache.cassandra:java-driver-mapper-processor;4.19.0 -org.apache.cassandra:java-driver-mapper-runtime;4.19.0 -org.apache.cassandra:java-driver-metrics-micrometer;4.19.0 -org.apache.cassandra:java-driver-metrics-microprofile;4.19.0 -org.apache.cassandra:java-driver-query-builder;4.19.0 -org.apache.cassandra:java-driver-test-infra;4.19.0 +org.apache.cassandra:java-driver-bom;4.19.2 +org.apache.cassandra:java-driver-core;4.19.2 +org.apache.cassandra:java-driver-core-shaded;4.19.2 +org.apache.cassandra:java-driver-guava-shaded;4.19.2 +org.apache.cassandra:java-driver-mapper-processor;4.19.2 +org.apache.cassandra:java-driver-mapper-runtime;4.19.2 +org.apache.cassandra:java-driver-metrics-micrometer;4.19.2 +org.apache.cassandra:java-driver-metrics-microprofile;4.19.2 +org.apache.cassandra:java-driver-query-builder;4.19.2 +org.apache.cassandra:java-driver-test-infra;4.19.2 org.apache.commons:commons-dbcp2;2.13.0 org.apache.commons:commons-lang3;3.17.0 org.apache.commons:commons-pool2;2.12.1 @@ -697,43 +697,43 @@ org.apache.derby:derbynet;10.16.1.1 org.apache.derby:derbyoptionaltools;10.16.1.1 org.apache.derby:derbyshared;10.16.1.1 org.apache.derby:derbytools;10.16.1.1 -org.apache.groovy:groovy;4.0.28 -org.apache.groovy:groovy-ant;4.0.28 -org.apache.groovy:groovy-astbuilder;4.0.28 -org.apache.groovy:groovy-bom;4.0.28 -org.apache.groovy:groovy-cli-commons;4.0.28 -org.apache.groovy:groovy-cli-picocli;4.0.28 -org.apache.groovy:groovy-console;4.0.28 -org.apache.groovy:groovy-contracts;4.0.28 -org.apache.groovy:groovy-datetime;4.0.28 -org.apache.groovy:groovy-dateutil;4.0.28 -org.apache.groovy:groovy-docgenerator;4.0.28 -org.apache.groovy:groovy-ginq;4.0.28 -org.apache.groovy:groovy-groovydoc;4.0.28 -org.apache.groovy:groovy-groovysh;4.0.28 -org.apache.groovy:groovy-jmx;4.0.28 -org.apache.groovy:groovy-json;4.0.28 -org.apache.groovy:groovy-jsr223;4.0.28 -org.apache.groovy:groovy-macro;4.0.28 -org.apache.groovy:groovy-macro-library;4.0.28 -org.apache.groovy:groovy-nio;4.0.28 -org.apache.groovy:groovy-servlet;4.0.28 -org.apache.groovy:groovy-sql;4.0.28 -org.apache.groovy:groovy-swing;4.0.28 -org.apache.groovy:groovy-templates;4.0.28 -org.apache.groovy:groovy-test;4.0.28 -org.apache.groovy:groovy-test-junit5;4.0.28 -org.apache.groovy:groovy-testng;4.0.28 -org.apache.groovy:groovy-toml;4.0.28 -org.apache.groovy:groovy-typecheckers;4.0.28 -org.apache.groovy:groovy-xml;4.0.28 -org.apache.groovy:groovy-yaml;4.0.28 -org.apache.httpcomponents.client5:httpclient5;5.5 -org.apache.httpcomponents.client5:httpclient5-cache;5.5 -org.apache.httpcomponents.client5:httpclient5-fluent;5.5 -org.apache.httpcomponents.core5:httpcore5;5.3.4 -org.apache.httpcomponents.core5:httpcore5-h2;5.3.4 -org.apache.httpcomponents.core5:httpcore5-reactive;5.3.4 +org.apache.groovy:groovy;4.0.29 +org.apache.groovy:groovy-ant;4.0.29 +org.apache.groovy:groovy-astbuilder;4.0.29 +org.apache.groovy:groovy-bom;4.0.29 +org.apache.groovy:groovy-cli-commons;4.0.29 +org.apache.groovy:groovy-cli-picocli;4.0.29 +org.apache.groovy:groovy-console;4.0.29 +org.apache.groovy:groovy-contracts;4.0.29 +org.apache.groovy:groovy-datetime;4.0.29 +org.apache.groovy:groovy-dateutil;4.0.29 +org.apache.groovy:groovy-docgenerator;4.0.29 +org.apache.groovy:groovy-ginq;4.0.29 +org.apache.groovy:groovy-groovydoc;4.0.29 +org.apache.groovy:groovy-groovysh;4.0.29 +org.apache.groovy:groovy-jmx;4.0.29 +org.apache.groovy:groovy-json;4.0.29 +org.apache.groovy:groovy-jsr223;4.0.29 +org.apache.groovy:groovy-macro;4.0.29 +org.apache.groovy:groovy-macro-library;4.0.29 +org.apache.groovy:groovy-nio;4.0.29 +org.apache.groovy:groovy-servlet;4.0.29 +org.apache.groovy:groovy-sql;4.0.29 +org.apache.groovy:groovy-swing;4.0.29 +org.apache.groovy:groovy-templates;4.0.29 +org.apache.groovy:groovy-test;4.0.29 +org.apache.groovy:groovy-test-junit5;4.0.29 +org.apache.groovy:groovy-testng;4.0.29 +org.apache.groovy:groovy-toml;4.0.29 +org.apache.groovy:groovy-typecheckers;4.0.29 +org.apache.groovy:groovy-xml;4.0.29 +org.apache.groovy:groovy-yaml;4.0.29 +org.apache.httpcomponents.client5:httpclient5;5.5.1 +org.apache.httpcomponents.client5:httpclient5-cache;5.5.1 +org.apache.httpcomponents.client5:httpclient5-fluent;5.5.1 +org.apache.httpcomponents.core5:httpcore5;5.3.6 +org.apache.httpcomponents.core5:httpcore5-h2;5.3.6 +org.apache.httpcomponents.core5:httpcore5-reactive;5.3.6 org.apache.httpcomponents:httpasyncclient;4.1.5 org.apache.httpcomponents:httpcore;4.4.16 org.apache.httpcomponents:httpcore-nio;4.4.16 @@ -796,11 +796,11 @@ org.apache.logging.log4j:log4j-web;2.24.3 org.apache.maven.plugins:maven-antrun-plugin;3.1.0 org.apache.maven.plugins:maven-assembly-plugin;3.7.1 org.apache.maven.plugins:maven-clean-plugin;3.4.1 -org.apache.maven.plugins:maven-compiler-plugin;3.14.0 +org.apache.maven.plugins:maven-compiler-plugin;3.14.1 org.apache.maven.plugins:maven-dependency-plugin;3.8.1 org.apache.maven.plugins:maven-deploy-plugin;3.1.4 org.apache.maven.plugins:maven-enforcer-plugin;3.5.0 -org.apache.maven.plugins:maven-failsafe-plugin;3.5.3 +org.apache.maven.plugins:maven-failsafe-plugin;3.5.4 org.apache.maven.plugins:maven-gpg-plugin;3.1.0 org.apache.maven.plugins:maven-help-plugin;3.5.1 org.apache.maven.plugins:maven-install-plugin;3.1.4 @@ -809,140 +809,140 @@ org.apache.maven.plugins:maven-jar-plugin;3.4.2 org.apache.maven.plugins:maven-javadoc-plugin;3.11.3 org.apache.maven.plugins:maven-release-plugin;2.5.3 org.apache.maven.plugins:maven-resources-plugin;3.3.1 -org.apache.maven.plugins:maven-shade-plugin;3.6.0 +org.apache.maven.plugins:maven-shade-plugin;3.6.1 org.apache.maven.plugins:maven-source-plugin;3.3.1 -org.apache.maven.plugins:maven-surefire-plugin;3.5.3 +org.apache.maven.plugins:maven-surefire-plugin;3.5.4 org.apache.maven.plugins:maven-war-plugin;3.4.0 -org.apache.pulsar:bouncy-castle-bc;4.0.6 -org.apache.pulsar:bouncy-castle-bcfips;4.0.6 -org.apache.pulsar:bouncy-castle-parent;4.0.6 -org.apache.pulsar:buildtools;4.0.6 -org.apache.pulsar:distribution;4.0.6 -org.apache.pulsar:docker-images;4.0.6 -org.apache.pulsar:jclouds-shaded;4.0.6 -org.apache.pulsar:managed-ledger;4.0.6 -org.apache.pulsar:pulsar;4.0.6 -org.apache.pulsar:pulsar-all-docker-image;4.0.6 -org.apache.pulsar:pulsar-bom;4.0.6 -org.apache.pulsar:pulsar-broker;4.0.6 -org.apache.pulsar:pulsar-broker-auth-athenz;4.0.6 -org.apache.pulsar:pulsar-broker-auth-oidc;4.0.6 -org.apache.pulsar:pulsar-broker-auth-sasl;4.0.6 -org.apache.pulsar:pulsar-broker-common;4.0.6 -org.apache.pulsar:pulsar-cli-utils;4.0.6 -org.apache.pulsar:pulsar-client;4.0.6 -org.apache.pulsar:pulsar-client-admin;4.0.6 -org.apache.pulsar:pulsar-client-admin-api;4.0.6 -org.apache.pulsar:pulsar-client-admin-original;4.0.6 -org.apache.pulsar:pulsar-client-all;4.0.6 -org.apache.pulsar:pulsar-client-api;4.0.6 -org.apache.pulsar:pulsar-client-auth-athenz;4.0.6 -org.apache.pulsar:pulsar-client-auth-sasl;4.0.6 -org.apache.pulsar:pulsar-client-messagecrypto-bc;4.0.6 -org.apache.pulsar:pulsar-client-original;4.0.6 +org.apache.pulsar:bouncy-castle-bc;4.0.8 +org.apache.pulsar:bouncy-castle-bcfips;4.0.8 +org.apache.pulsar:bouncy-castle-parent;4.0.8 +org.apache.pulsar:buildtools;4.0.8 +org.apache.pulsar:distribution;4.0.8 +org.apache.pulsar:docker-images;4.0.8 +org.apache.pulsar:jclouds-shaded;4.0.8 +org.apache.pulsar:managed-ledger;4.0.8 +org.apache.pulsar:pulsar;4.0.8 +org.apache.pulsar:pulsar-all-docker-image;4.0.8 +org.apache.pulsar:pulsar-bom;4.0.8 +org.apache.pulsar:pulsar-broker;4.0.8 +org.apache.pulsar:pulsar-broker-auth-athenz;4.0.8 +org.apache.pulsar:pulsar-broker-auth-oidc;4.0.8 +org.apache.pulsar:pulsar-broker-auth-sasl;4.0.8 +org.apache.pulsar:pulsar-broker-common;4.0.8 +org.apache.pulsar:pulsar-cli-utils;4.0.8 +org.apache.pulsar:pulsar-client;4.0.8 +org.apache.pulsar:pulsar-client-admin;4.0.8 +org.apache.pulsar:pulsar-client-admin-api;4.0.8 +org.apache.pulsar:pulsar-client-admin-original;4.0.8 +org.apache.pulsar:pulsar-client-all;4.0.8 +org.apache.pulsar:pulsar-client-api;4.0.8 +org.apache.pulsar:pulsar-client-auth-athenz;4.0.8 +org.apache.pulsar:pulsar-client-auth-sasl;4.0.8 +org.apache.pulsar:pulsar-client-messagecrypto-bc;4.0.8 +org.apache.pulsar:pulsar-client-original;4.0.8 org.apache.pulsar:pulsar-client-reactive-adapter;0.6.0 org.apache.pulsar:pulsar-client-reactive-api;0.6.0 org.apache.pulsar:pulsar-client-reactive-bom;0.6.0 org.apache.pulsar:pulsar-client-reactive-jackson;0.6.0 org.apache.pulsar:pulsar-client-reactive-producer-cache-caffeine;0.6.0 org.apache.pulsar:pulsar-client-reactive-producer-cache-caffeine-shaded;0.6.0 -org.apache.pulsar:pulsar-client-tools;4.0.6 -org.apache.pulsar:pulsar-client-tools-api;4.0.6 -org.apache.pulsar:pulsar-common;4.0.6 -org.apache.pulsar:pulsar-config-validation;4.0.6 -org.apache.pulsar:pulsar-docker-image;4.0.6 -org.apache.pulsar:pulsar-docs-tools;4.0.6 -org.apache.pulsar:pulsar-functions;4.0.6 -org.apache.pulsar:pulsar-functions-api;4.0.6 -org.apache.pulsar:pulsar-functions-api-examples;4.0.6 -org.apache.pulsar:pulsar-functions-api-examples-builtin;4.0.6 -org.apache.pulsar:pulsar-functions-instance;4.0.6 -org.apache.pulsar:pulsar-functions-local-runner;4.0.6 -org.apache.pulsar:pulsar-functions-local-runner-original;4.0.6 -org.apache.pulsar:pulsar-functions-proto;4.0.6 -org.apache.pulsar:pulsar-functions-runtime;4.0.6 -org.apache.pulsar:pulsar-functions-runtime-all;4.0.6 -org.apache.pulsar:pulsar-functions-secrets;4.0.6 -org.apache.pulsar:pulsar-functions-utils;4.0.6 -org.apache.pulsar:pulsar-functions-worker;4.0.6 -org.apache.pulsar:pulsar-io;4.0.6 -org.apache.pulsar:pulsar-io-aerospike;4.0.6 -org.apache.pulsar:pulsar-io-alluxio;4.0.6 -org.apache.pulsar:pulsar-io-aws;4.0.6 -org.apache.pulsar:pulsar-io-batch-data-generator;4.0.6 -org.apache.pulsar:pulsar-io-batch-discovery-triggerers;4.0.6 -org.apache.pulsar:pulsar-io-canal;4.0.6 -org.apache.pulsar:pulsar-io-cassandra;4.0.6 -org.apache.pulsar:pulsar-io-common;4.0.6 -org.apache.pulsar:pulsar-io-core;4.0.6 -org.apache.pulsar:pulsar-io-data-generator;4.0.6 -org.apache.pulsar:pulsar-io-debezium;4.0.6 -org.apache.pulsar:pulsar-io-debezium-core;4.0.6 -org.apache.pulsar:pulsar-io-debezium-mongodb;4.0.6 -org.apache.pulsar:pulsar-io-debezium-mssql;4.0.6 -org.apache.pulsar:pulsar-io-debezium-mysql;4.0.6 -org.apache.pulsar:pulsar-io-debezium-oracle;4.0.6 -org.apache.pulsar:pulsar-io-debezium-postgres;4.0.6 -org.apache.pulsar:pulsar-io-distribution;4.0.6 -org.apache.pulsar:pulsar-io-docs;4.0.6 -org.apache.pulsar:pulsar-io-dynamodb;4.0.6 -org.apache.pulsar:pulsar-io-elastic-search;4.0.6 -org.apache.pulsar:pulsar-io-file;4.0.6 -org.apache.pulsar:pulsar-io-flume;4.0.6 -org.apache.pulsar:pulsar-io-hbase;4.0.6 -org.apache.pulsar:pulsar-io-hdfs3;4.0.6 -org.apache.pulsar:pulsar-io-http;4.0.6 -org.apache.pulsar:pulsar-io-influxdb;4.0.6 -org.apache.pulsar:pulsar-io-jdbc;4.0.6 -org.apache.pulsar:pulsar-io-jdbc-clickhouse;4.0.6 -org.apache.pulsar:pulsar-io-jdbc-core;4.0.6 -org.apache.pulsar:pulsar-io-jdbc-mariadb;4.0.6 -org.apache.pulsar:pulsar-io-jdbc-openmldb;4.0.6 -org.apache.pulsar:pulsar-io-jdbc-postgres;4.0.6 -org.apache.pulsar:pulsar-io-jdbc-sqlite;4.0.6 -org.apache.pulsar:pulsar-io-kafka;4.0.6 -org.apache.pulsar:pulsar-io-kafka-connect-adaptor;4.0.6 -org.apache.pulsar:pulsar-io-kafka-connect-adaptor-nar;4.0.6 -org.apache.pulsar:pulsar-io-kinesis;4.0.6 -org.apache.pulsar:pulsar-io-mongo;4.0.6 -org.apache.pulsar:pulsar-io-netty;4.0.6 -org.apache.pulsar:pulsar-io-nsq;4.0.6 -org.apache.pulsar:pulsar-io-rabbitmq;4.0.6 -org.apache.pulsar:pulsar-io-redis;4.0.6 -org.apache.pulsar:pulsar-io-solr;4.0.6 -org.apache.pulsar:pulsar-io-twitter;4.0.6 -org.apache.pulsar:pulsar-metadata;4.0.6 -org.apache.pulsar:pulsar-offloader-distribution;4.0.6 -org.apache.pulsar:pulsar-package-bookkeeper-storage;4.0.6 -org.apache.pulsar:pulsar-package-core;4.0.6 -org.apache.pulsar:pulsar-package-filesystem-storage;4.0.6 -org.apache.pulsar:pulsar-package-management;4.0.6 -org.apache.pulsar:pulsar-proxy;4.0.6 -org.apache.pulsar:pulsar-server-distribution;4.0.6 -org.apache.pulsar:pulsar-shell-distribution;4.0.6 -org.apache.pulsar:pulsar-testclient;4.0.6 -org.apache.pulsar:pulsar-transaction-common;4.0.6 -org.apache.pulsar:pulsar-transaction-coordinator;4.0.6 -org.apache.pulsar:pulsar-transaction-parent;4.0.6 -org.apache.pulsar:pulsar-websocket;4.0.6 -org.apache.pulsar:structured-event-log;4.0.6 -org.apache.pulsar:testmocks;4.0.6 -org.apache.pulsar:tiered-storage-file-system;4.0.6 -org.apache.pulsar:tiered-storage-jcloud;4.0.6 -org.apache.pulsar:tiered-storage-parent;4.0.6 -org.apache.tomcat.embed:tomcat-embed-core;10.1.44 -org.apache.tomcat.embed:tomcat-embed-el;10.1.44 -org.apache.tomcat.embed:tomcat-embed-jasper;10.1.44 -org.apache.tomcat.embed:tomcat-embed-websocket;10.1.44 -org.apache.tomcat:tomcat-annotations-api;10.1.44 -org.apache.tomcat:tomcat-jdbc;10.1.44 -org.apache.tomcat:tomcat-jsp-api;10.1.44 -org.aspectj:aspectjrt;1.9.24 -org.aspectj:aspectjtools;1.9.24 -org.aspectj:aspectjweaver;1.9.24 -org.assertj:assertj-bom;3.27.4 -org.assertj:assertj-core;3.27.4 -org.assertj:assertj-guava;3.27.4 +org.apache.pulsar:pulsar-client-tools;4.0.8 +org.apache.pulsar:pulsar-client-tools-api;4.0.8 +org.apache.pulsar:pulsar-common;4.0.8 +org.apache.pulsar:pulsar-config-validation;4.0.8 +org.apache.pulsar:pulsar-docker-image;4.0.8 +org.apache.pulsar:pulsar-docs-tools;4.0.8 +org.apache.pulsar:pulsar-functions;4.0.8 +org.apache.pulsar:pulsar-functions-api;4.0.8 +org.apache.pulsar:pulsar-functions-api-examples;4.0.8 +org.apache.pulsar:pulsar-functions-api-examples-builtin;4.0.8 +org.apache.pulsar:pulsar-functions-instance;4.0.8 +org.apache.pulsar:pulsar-functions-local-runner;4.0.8 +org.apache.pulsar:pulsar-functions-local-runner-original;4.0.8 +org.apache.pulsar:pulsar-functions-proto;4.0.8 +org.apache.pulsar:pulsar-functions-runtime;4.0.8 +org.apache.pulsar:pulsar-functions-runtime-all;4.0.8 +org.apache.pulsar:pulsar-functions-secrets;4.0.8 +org.apache.pulsar:pulsar-functions-utils;4.0.8 +org.apache.pulsar:pulsar-functions-worker;4.0.8 +org.apache.pulsar:pulsar-io;4.0.8 +org.apache.pulsar:pulsar-io-aerospike;4.0.8 +org.apache.pulsar:pulsar-io-alluxio;4.0.8 +org.apache.pulsar:pulsar-io-aws;4.0.8 +org.apache.pulsar:pulsar-io-batch-data-generator;4.0.8 +org.apache.pulsar:pulsar-io-batch-discovery-triggerers;4.0.8 +org.apache.pulsar:pulsar-io-canal;4.0.8 +org.apache.pulsar:pulsar-io-cassandra;4.0.8 +org.apache.pulsar:pulsar-io-common;4.0.8 +org.apache.pulsar:pulsar-io-core;4.0.8 +org.apache.pulsar:pulsar-io-data-generator;4.0.8 +org.apache.pulsar:pulsar-io-debezium;4.0.8 +org.apache.pulsar:pulsar-io-debezium-core;4.0.8 +org.apache.pulsar:pulsar-io-debezium-mongodb;4.0.8 +org.apache.pulsar:pulsar-io-debezium-mssql;4.0.8 +org.apache.pulsar:pulsar-io-debezium-mysql;4.0.8 +org.apache.pulsar:pulsar-io-debezium-oracle;4.0.8 +org.apache.pulsar:pulsar-io-debezium-postgres;4.0.8 +org.apache.pulsar:pulsar-io-distribution;4.0.8 +org.apache.pulsar:pulsar-io-docs;4.0.8 +org.apache.pulsar:pulsar-io-dynamodb;4.0.8 +org.apache.pulsar:pulsar-io-elastic-search;4.0.8 +org.apache.pulsar:pulsar-io-file;4.0.8 +org.apache.pulsar:pulsar-io-flume;4.0.8 +org.apache.pulsar:pulsar-io-hbase;4.0.8 +org.apache.pulsar:pulsar-io-hdfs3;4.0.8 +org.apache.pulsar:pulsar-io-http;4.0.8 +org.apache.pulsar:pulsar-io-influxdb;4.0.8 +org.apache.pulsar:pulsar-io-jdbc;4.0.8 +org.apache.pulsar:pulsar-io-jdbc-clickhouse;4.0.8 +org.apache.pulsar:pulsar-io-jdbc-core;4.0.8 +org.apache.pulsar:pulsar-io-jdbc-mariadb;4.0.8 +org.apache.pulsar:pulsar-io-jdbc-openmldb;4.0.8 +org.apache.pulsar:pulsar-io-jdbc-postgres;4.0.8 +org.apache.pulsar:pulsar-io-jdbc-sqlite;4.0.8 +org.apache.pulsar:pulsar-io-kafka;4.0.8 +org.apache.pulsar:pulsar-io-kafka-connect-adaptor;4.0.8 +org.apache.pulsar:pulsar-io-kafka-connect-adaptor-nar;4.0.8 +org.apache.pulsar:pulsar-io-kinesis;4.0.8 +org.apache.pulsar:pulsar-io-mongo;4.0.8 +org.apache.pulsar:pulsar-io-netty;4.0.8 +org.apache.pulsar:pulsar-io-nsq;4.0.8 +org.apache.pulsar:pulsar-io-rabbitmq;4.0.8 +org.apache.pulsar:pulsar-io-redis;4.0.8 +org.apache.pulsar:pulsar-io-solr;4.0.8 +org.apache.pulsar:pulsar-io-twitter;4.0.8 +org.apache.pulsar:pulsar-metadata;4.0.8 +org.apache.pulsar:pulsar-offloader-distribution;4.0.8 +org.apache.pulsar:pulsar-package-bookkeeper-storage;4.0.8 +org.apache.pulsar:pulsar-package-core;4.0.8 +org.apache.pulsar:pulsar-package-filesystem-storage;4.0.8 +org.apache.pulsar:pulsar-package-management;4.0.8 +org.apache.pulsar:pulsar-proxy;4.0.8 +org.apache.pulsar:pulsar-server-distribution;4.0.8 +org.apache.pulsar:pulsar-shell-distribution;4.0.8 +org.apache.pulsar:pulsar-testclient;4.0.8 +org.apache.pulsar:pulsar-transaction-common;4.0.8 +org.apache.pulsar:pulsar-transaction-coordinator;4.0.8 +org.apache.pulsar:pulsar-transaction-parent;4.0.8 +org.apache.pulsar:pulsar-websocket;4.0.8 +org.apache.pulsar:structured-event-log;4.0.8 +org.apache.pulsar:testmocks;4.0.8 +org.apache.pulsar:tiered-storage-file-system;4.0.8 +org.apache.pulsar:tiered-storage-jcloud;4.0.8 +org.apache.pulsar:tiered-storage-parent;4.0.8 +org.apache.tomcat.embed:tomcat-embed-core;10.1.50 +org.apache.tomcat.embed:tomcat-embed-el;10.1.50 +org.apache.tomcat.embed:tomcat-embed-jasper;10.1.50 +org.apache.tomcat.embed:tomcat-embed-websocket;10.1.50 +org.apache.tomcat:tomcat-annotations-api;10.1.50 +org.apache.tomcat:tomcat-jdbc;10.1.50 +org.apache.tomcat:tomcat-jsp-api;10.1.50 +org.aspectj:aspectjrt;1.9.25.1 +org.aspectj:aspectjtools;1.9.25.1 +org.aspectj:aspectjweaver;1.9.25.1 +org.assertj:assertj-bom;3.27.6 +org.assertj:assertj-core;3.27.6 +org.assertj:assertj-guava;3.27.6 org.awaitility:awaitility;4.2.2 org.awaitility:awaitility-groovy;4.2.2 org.awaitility:awaitility-kotlin;4.2.2 @@ -961,113 +961,113 @@ org.codehaus.mojo:versions-maven-plugin;2.18.0 org.codehaus.mojo:xml-maven-plugin;1.1.0 org.crac:crac;1.5.0 org.cyclonedx:cyclonedx-maven-plugin;2.9.1 -org.eclipse.angus:angus-activation;2.0.2 -org.eclipse.angus:angus-core;2.0.4 -org.eclipse.angus:angus-mail;2.0.4 -org.eclipse.angus:dsn;2.0.4 -org.eclipse.angus:gimap;2.0.4 -org.eclipse.angus:imap;2.0.4 -org.eclipse.angus:jakarta.mail;2.0.4 -org.eclipse.angus:logging-mailhandler;2.0.4 -org.eclipse.angus:pop3;2.0.4 -org.eclipse.angus:smtp;2.0.4 -org.eclipse.jetty.demos:jetty-demo-handler;12.0.25 -org.eclipse.jetty.ee10.osgi:jetty-ee10-osgi-alpn;12.0.25 -org.eclipse.jetty.ee10.osgi:jetty-ee10-osgi-boot;12.0.25 -org.eclipse.jetty.ee10.osgi:jetty-ee10-osgi-boot-jsp;12.0.25 -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-client;12.0.25 -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-client-webapp;12.0.25 -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-common;12.0.25 -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-server;12.0.25 -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jetty-client-webapp;12.0.25 -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jetty-server;12.0.25 -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-servlet;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-annotations;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-apache-jsp;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-bom;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-cdi;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-fcgi-proxy;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-glassfish-jstl;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-jaspi;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-jndi;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-jspc-maven-plugin;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-maven-plugin;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-plus;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-proxy;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-quickstart;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-runner;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-servlet;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-servlets;12.0.25 -org.eclipse.jetty.ee10:jetty-ee10-webapp;12.0.25 -org.eclipse.jetty.fcgi:jetty-fcgi-client;12.0.25 -org.eclipse.jetty.fcgi:jetty-fcgi-proxy;12.0.25 -org.eclipse.jetty.fcgi:jetty-fcgi-server;12.0.25 -org.eclipse.jetty.http2:jetty-http2-client;12.0.25 -org.eclipse.jetty.http2:jetty-http2-client-transport;12.0.25 -org.eclipse.jetty.http2:jetty-http2-common;12.0.25 -org.eclipse.jetty.http2:jetty-http2-hpack;12.0.25 -org.eclipse.jetty.http2:jetty-http2-server;12.0.25 -org.eclipse.jetty.http3:jetty-http3-client;12.0.25 -org.eclipse.jetty.http3:jetty-http3-client-transport;12.0.25 -org.eclipse.jetty.http3:jetty-http3-common;12.0.25 -org.eclipse.jetty.http3:jetty-http3-qpack;12.0.25 -org.eclipse.jetty.http3:jetty-http3-server;12.0.25 -org.eclipse.jetty.quic:jetty-quic-client;12.0.25 -org.eclipse.jetty.quic:jetty-quic-common;12.0.25 -org.eclipse.jetty.quic:jetty-quic-quiche-common;12.0.25 -org.eclipse.jetty.quic:jetty-quic-quiche-foreign;12.0.25 -org.eclipse.jetty.quic:jetty-quic-quiche-jna;12.0.25 -org.eclipse.jetty.quic:jetty-quic-server;12.0.25 -org.eclipse.jetty.websocket:jetty-websocket-core-client;12.0.25 -org.eclipse.jetty.websocket:jetty-websocket-core-common;12.0.25 -org.eclipse.jetty.websocket:jetty-websocket-core-server;12.0.25 -org.eclipse.jetty.websocket:jetty-websocket-jetty-api;12.0.25 -org.eclipse.jetty.websocket:jetty-websocket-jetty-client;12.0.25 -org.eclipse.jetty.websocket:jetty-websocket-jetty-common;12.0.25 -org.eclipse.jetty.websocket:jetty-websocket-jetty-server;12.0.25 -org.eclipse.jetty:jetty-alpn-client;12.0.25 -org.eclipse.jetty:jetty-alpn-conscrypt-client;12.0.25 -org.eclipse.jetty:jetty-alpn-conscrypt-server;12.0.25 -org.eclipse.jetty:jetty-alpn-java-client;12.0.25 -org.eclipse.jetty:jetty-alpn-java-server;12.0.25 -org.eclipse.jetty:jetty-alpn-server;12.0.25 -org.eclipse.jetty:jetty-bom;12.0.25 -org.eclipse.jetty:jetty-client;12.0.25 -org.eclipse.jetty:jetty-deploy;12.0.25 -org.eclipse.jetty:jetty-ee;12.0.25 -org.eclipse.jetty:jetty-http;12.0.25 -org.eclipse.jetty:jetty-http-spi;12.0.25 -org.eclipse.jetty:jetty-http-tools;12.0.25 -org.eclipse.jetty:jetty-io;12.0.25 -org.eclipse.jetty:jetty-jmx;12.0.25 -org.eclipse.jetty:jetty-jndi;12.0.25 -org.eclipse.jetty:jetty-keystore;12.0.25 -org.eclipse.jetty:jetty-openid;12.0.25 -org.eclipse.jetty:jetty-osgi;12.0.25 -org.eclipse.jetty:jetty-plus;12.0.25 -org.eclipse.jetty:jetty-proxy;12.0.25 -org.eclipse.jetty:jetty-reactive-httpclient;4.0.11 -org.eclipse.jetty:jetty-rewrite;12.0.25 -org.eclipse.jetty:jetty-security;12.0.25 -org.eclipse.jetty:jetty-server;12.0.25 -org.eclipse.jetty:jetty-session;12.0.25 -org.eclipse.jetty:jetty-slf4j-impl;12.0.25 -org.eclipse.jetty:jetty-start;12.0.25 -org.eclipse.jetty:jetty-unixdomain-server;12.0.25 -org.eclipse.jetty:jetty-util;12.0.25 -org.eclipse.jetty:jetty-util-ajax;12.0.25 -org.eclipse.jetty:jetty-xml;12.0.25 +org.eclipse.angus:angus-activation;2.0.3 +org.eclipse.angus:angus-core;2.0.5 +org.eclipse.angus:angus-mail;2.0.5 +org.eclipse.angus:dsn;2.0.5 +org.eclipse.angus:gimap;2.0.5 +org.eclipse.angus:imap;2.0.5 +org.eclipse.angus:jakarta.mail;2.0.5 +org.eclipse.angus:logging-mailhandler;2.0.5 +org.eclipse.angus:pop3;2.0.5 +org.eclipse.angus:smtp;2.0.5 +org.eclipse.jetty.demos:jetty-demo-handler;12.0.31 +org.eclipse.jetty.ee10.osgi:jetty-ee10-osgi-alpn;12.0.31 +org.eclipse.jetty.ee10.osgi:jetty-ee10-osgi-boot;12.0.31 +org.eclipse.jetty.ee10.osgi:jetty-ee10-osgi-boot-jsp;12.0.31 +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-client;12.0.31 +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-client-webapp;12.0.31 +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-common;12.0.31 +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-server;12.0.31 +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jetty-client-webapp;12.0.31 +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jetty-server;12.0.31 +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-servlet;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-annotations;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-apache-jsp;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-bom;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-cdi;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-fcgi-proxy;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-glassfish-jstl;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-jaspi;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-jndi;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-jspc-maven-plugin;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-maven-plugin;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-plus;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-proxy;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-quickstart;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-runner;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-servlet;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-servlets;12.0.31 +org.eclipse.jetty.ee10:jetty-ee10-webapp;12.0.31 +org.eclipse.jetty.fcgi:jetty-fcgi-client;12.0.31 +org.eclipse.jetty.fcgi:jetty-fcgi-proxy;12.0.31 +org.eclipse.jetty.fcgi:jetty-fcgi-server;12.0.31 +org.eclipse.jetty.http2:jetty-http2-client;12.0.31 +org.eclipse.jetty.http2:jetty-http2-client-transport;12.0.31 +org.eclipse.jetty.http2:jetty-http2-common;12.0.31 +org.eclipse.jetty.http2:jetty-http2-hpack;12.0.31 +org.eclipse.jetty.http2:jetty-http2-server;12.0.31 +org.eclipse.jetty.http3:jetty-http3-client;12.0.31 +org.eclipse.jetty.http3:jetty-http3-client-transport;12.0.31 +org.eclipse.jetty.http3:jetty-http3-common;12.0.31 +org.eclipse.jetty.http3:jetty-http3-qpack;12.0.31 +org.eclipse.jetty.http3:jetty-http3-server;12.0.31 +org.eclipse.jetty.quic:jetty-quic-client;12.0.31 +org.eclipse.jetty.quic:jetty-quic-common;12.0.31 +org.eclipse.jetty.quic:jetty-quic-quiche-common;12.0.31 +org.eclipse.jetty.quic:jetty-quic-quiche-foreign;12.0.31 +org.eclipse.jetty.quic:jetty-quic-quiche-jna;12.0.31 +org.eclipse.jetty.quic:jetty-quic-server;12.0.31 +org.eclipse.jetty.websocket:jetty-websocket-core-client;12.0.31 +org.eclipse.jetty.websocket:jetty-websocket-core-common;12.0.31 +org.eclipse.jetty.websocket:jetty-websocket-core-server;12.0.31 +org.eclipse.jetty.websocket:jetty-websocket-jetty-api;12.0.31 +org.eclipse.jetty.websocket:jetty-websocket-jetty-client;12.0.31 +org.eclipse.jetty.websocket:jetty-websocket-jetty-common;12.0.31 +org.eclipse.jetty.websocket:jetty-websocket-jetty-server;12.0.31 +org.eclipse.jetty:jetty-alpn-client;12.0.31 +org.eclipse.jetty:jetty-alpn-conscrypt-client;12.0.31 +org.eclipse.jetty:jetty-alpn-conscrypt-server;12.0.31 +org.eclipse.jetty:jetty-alpn-java-client;12.0.31 +org.eclipse.jetty:jetty-alpn-java-server;12.0.31 +org.eclipse.jetty:jetty-alpn-server;12.0.31 +org.eclipse.jetty:jetty-bom;12.0.31 +org.eclipse.jetty:jetty-client;12.0.31 +org.eclipse.jetty:jetty-deploy;12.0.31 +org.eclipse.jetty:jetty-ee;12.0.31 +org.eclipse.jetty:jetty-http;12.0.31 +org.eclipse.jetty:jetty-http-spi;12.0.31 +org.eclipse.jetty:jetty-http-tools;12.0.31 +org.eclipse.jetty:jetty-io;12.0.31 +org.eclipse.jetty:jetty-jmx;12.0.31 +org.eclipse.jetty:jetty-jndi;12.0.31 +org.eclipse.jetty:jetty-keystore;12.0.31 +org.eclipse.jetty:jetty-openid;12.0.31 +org.eclipse.jetty:jetty-osgi;12.0.31 +org.eclipse.jetty:jetty-plus;12.0.31 +org.eclipse.jetty:jetty-proxy;12.0.31 +org.eclipse.jetty:jetty-reactive-httpclient;4.0.13 +org.eclipse.jetty:jetty-rewrite;12.0.31 +org.eclipse.jetty:jetty-security;12.0.31 +org.eclipse.jetty:jetty-server;12.0.31 +org.eclipse.jetty:jetty-session;12.0.31 +org.eclipse.jetty:jetty-slf4j-impl;12.0.31 +org.eclipse.jetty:jetty-start;12.0.31 +org.eclipse.jetty:jetty-unixdomain-server;12.0.31 +org.eclipse.jetty:jetty-util;12.0.31 +org.eclipse.jetty:jetty-util-ajax;12.0.31 +org.eclipse.jetty:jetty-xml;12.0.31 org.eclipse.jgit:org.eclipse.jgit;6.10.1.202505221210-r org.eclipse.jgit:org.eclipse.jgit.http.apache;6.10.1.202505221210-r org.eclipse.jgit:org.eclipse.jgit.junit.http;6.10.1.202505221210-r org.eclipse.jgit:org.eclipse.jgit.ssh.apache;6.10.1.202505221210-r org.eclipse:yasson;3.0.4 -org.ehcache:ehcache;3.10.8 -org.ehcache:ehcache-clustered;3.10.8 -org.ehcache:ehcache-transactions;3.10.8 -org.elasticsearch.client:elasticsearch-rest-client;8.18.5 -org.elasticsearch.client:elasticsearch-rest-client-sniffer;8.18.5 -org.firebirdsql.jdbc:jaybird;6.0.2 +org.ehcache:ehcache;3.10.9 +org.ehcache:ehcache-clustered;3.10.9 +org.ehcache:ehcache-transactions;3.10.9 +org.elasticsearch.client:elasticsearch-rest-client;8.18.8 +org.elasticsearch.client:elasticsearch-rest-client-sniffer;8.18.8 +org.firebirdsql.jdbc:jaybird;6.0.3 org.flywaydb:flyway-commandline;11.7.2 org.flywaydb:flyway-core;11.7.2 org.flywaydb:flyway-database-cassandra;11.7.2 @@ -1090,14 +1090,14 @@ org.flywaydb:flyway-mysql;11.7.2 org.flywaydb:flyway-singlestore;11.7.2 org.flywaydb:flyway-sqlserver;11.7.2 org.freemarker:freemarker;2.3.34 -org.glassfish.jaxb:codemodel;4.0.5 -org.glassfish.jaxb:jaxb-bom;4.0.5 -org.glassfish.jaxb:jaxb-core;4.0.5 -org.glassfish.jaxb:jaxb-jxc;4.0.5 -org.glassfish.jaxb:jaxb-runtime;4.0.5 -org.glassfish.jaxb:jaxb-xjc;4.0.5 -org.glassfish.jaxb:txw2;4.0.5 -org.glassfish.jaxb:xsom;4.0.5 +org.glassfish.jaxb:codemodel;4.0.6 +org.glassfish.jaxb:jaxb-bom;4.0.6 +org.glassfish.jaxb:jaxb-core;4.0.6 +org.glassfish.jaxb:jaxb-jxc;4.0.6 +org.glassfish.jaxb:jaxb-runtime;4.0.6 +org.glassfish.jaxb:jaxb-xjc;4.0.6 +org.glassfish.jaxb:txw2;4.0.6 +org.glassfish.jaxb:xsom;4.0.6 org.glassfish.jersey.bundles:jaxrs-ri;3.1.11 org.glassfish.jersey.connectors:jersey-apache-connector;3.1.11 org.glassfish.jersey.connectors:jersey-apache5-connector;3.1.11 @@ -1182,21 +1182,21 @@ org.graalvm.buildtools:native-maven-plugin;0.10.6 org.hamcrest:hamcrest;3.0 org.hamcrest:hamcrest-core;3.0 org.hamcrest:hamcrest-library;3.0 -org.hibernate.orm:hibernate-agroal;6.6.26.Final -org.hibernate.orm:hibernate-ant;6.6.26.Final -org.hibernate.orm:hibernate-c3p0;6.6.26.Final -org.hibernate.orm:hibernate-community-dialects;6.6.26.Final -org.hibernate.orm:hibernate-core;6.6.26.Final -org.hibernate.orm:hibernate-envers;6.6.26.Final -org.hibernate.orm:hibernate-graalvm;6.6.26.Final -org.hibernate.orm:hibernate-hikaricp;6.6.26.Final -org.hibernate.orm:hibernate-jcache;6.6.26.Final -org.hibernate.orm:hibernate-jpamodelgen;6.6.26.Final -org.hibernate.orm:hibernate-micrometer;6.6.26.Final -org.hibernate.orm:hibernate-proxool;6.6.26.Final -org.hibernate.orm:hibernate-spatial;6.6.26.Final -org.hibernate.orm:hibernate-testing;6.6.26.Final -org.hibernate.orm:hibernate-vibur;6.6.26.Final +org.hibernate.orm:hibernate-agroal;6.6.39.Final +org.hibernate.orm:hibernate-ant;6.6.39.Final +org.hibernate.orm:hibernate-c3p0;6.6.39.Final +org.hibernate.orm:hibernate-community-dialects;6.6.39.Final +org.hibernate.orm:hibernate-core;6.6.39.Final +org.hibernate.orm:hibernate-envers;6.6.39.Final +org.hibernate.orm:hibernate-graalvm;6.6.39.Final +org.hibernate.orm:hibernate-hikaricp;6.6.39.Final +org.hibernate.orm:hibernate-jcache;6.6.39.Final +org.hibernate.orm:hibernate-jpamodelgen;6.6.39.Final +org.hibernate.orm:hibernate-micrometer;6.6.39.Final +org.hibernate.orm:hibernate-proxool;6.6.39.Final +org.hibernate.orm:hibernate-spatial;6.6.39.Final +org.hibernate.orm:hibernate-testing;6.6.39.Final +org.hibernate.orm:hibernate-vibur;6.6.39.Final org.hibernate.validator:hibernate-validator;8.0.3.Final org.hibernate.validator:hibernate-validator-annotation-processor;8.0.3.Final org.hsqldb:hsqldb;2.7.3 @@ -1204,70 +1204,70 @@ org.htmlunit:htmlunit;4.11.1 org.infinispan.protostream:protostream;5.0.13.Final org.infinispan.protostream:protostream-processor;5.0.13.Final org.infinispan.protostream:protostream-types;5.0.13.Final -org.infinispan:infinispan-anchored-keys;15.2.5.Final -org.infinispan:infinispan-api;15.2.5.Final -org.infinispan:infinispan-bom;15.2.5.Final -org.infinispan:infinispan-cachestore-jdbc;15.2.5.Final -org.infinispan:infinispan-cachestore-jdbc-common;15.2.5.Final -org.infinispan:infinispan-cachestore-remote;15.2.5.Final -org.infinispan:infinispan-cachestore-rocksdb;15.2.5.Final -org.infinispan:infinispan-cachestore-sql;15.2.5.Final -org.infinispan:infinispan-cdi-common;15.2.5.Final -org.infinispan:infinispan-cdi-embedded;15.2.5.Final -org.infinispan:infinispan-cdi-remote;15.2.5.Final -org.infinispan:infinispan-checkstyle;15.2.5.Final -org.infinispan:infinispan-cli-client;15.2.5.Final -org.infinispan:infinispan-client-hotrod;15.2.5.Final -org.infinispan:infinispan-client-hotrod-legacy;15.2.5.Final -org.infinispan:infinispan-client-rest;15.2.5.Final -org.infinispan:infinispan-clustered-counter;15.2.5.Final -org.infinispan:infinispan-clustered-lock;15.2.5.Final -org.infinispan:infinispan-commons;15.2.5.Final -org.infinispan:infinispan-commons-graalvm;15.2.5.Final -org.infinispan:infinispan-commons-spi;15.2.5.Final -org.infinispan:infinispan-commons-test;15.2.5.Final -org.infinispan:infinispan-component-annotations;15.2.5.Final -org.infinispan:infinispan-component-processor;15.2.5.Final +org.infinispan:infinispan-anchored-keys;15.2.6.Final +org.infinispan:infinispan-api;15.2.6.Final +org.infinispan:infinispan-bom;15.2.6.Final +org.infinispan:infinispan-cachestore-jdbc;15.2.6.Final +org.infinispan:infinispan-cachestore-jdbc-common;15.2.6.Final +org.infinispan:infinispan-cachestore-remote;15.2.6.Final +org.infinispan:infinispan-cachestore-rocksdb;15.2.6.Final +org.infinispan:infinispan-cachestore-sql;15.2.6.Final +org.infinispan:infinispan-cdi-common;15.2.6.Final +org.infinispan:infinispan-cdi-embedded;15.2.6.Final +org.infinispan:infinispan-cdi-remote;15.2.6.Final +org.infinispan:infinispan-checkstyle;15.2.6.Final +org.infinispan:infinispan-cli-client;15.2.6.Final +org.infinispan:infinispan-client-hotrod;15.2.6.Final +org.infinispan:infinispan-client-hotrod-legacy;15.2.6.Final +org.infinispan:infinispan-client-rest;15.2.6.Final +org.infinispan:infinispan-clustered-counter;15.2.6.Final +org.infinispan:infinispan-clustered-lock;15.2.6.Final +org.infinispan:infinispan-commons;15.2.6.Final +org.infinispan:infinispan-commons-graalvm;15.2.6.Final +org.infinispan:infinispan-commons-spi;15.2.6.Final +org.infinispan:infinispan-commons-test;15.2.6.Final +org.infinispan:infinispan-component-annotations;15.2.6.Final +org.infinispan:infinispan-component-processor;15.2.6.Final org.infinispan:infinispan-console;15.2.1.Final -org.infinispan:infinispan-core;15.2.5.Final -org.infinispan:infinispan-core-graalvm;15.2.5.Final -org.infinispan:infinispan-counter-api;15.2.5.Final -org.infinispan:infinispan-hibernate-cache-commons;15.2.5.Final -org.infinispan:infinispan-hibernate-cache-spi;15.2.5.Final -org.infinispan:infinispan-hibernate-cache-v62;15.2.5.Final -org.infinispan:infinispan-jboss-marshalling;15.2.5.Final -org.infinispan:infinispan-jcache;15.2.5.Final -org.infinispan:infinispan-jcache-commons;15.2.5.Final -org.infinispan:infinispan-jcache-remote;15.2.5.Final -org.infinispan:infinispan-key-value-store-client;15.2.5.Final -org.infinispan:infinispan-logging-annotations;15.2.5.Final -org.infinispan:infinispan-logging-processor;15.2.5.Final -org.infinispan:infinispan-multimap;15.2.5.Final -org.infinispan:infinispan-objectfilter;15.2.5.Final -org.infinispan:infinispan-query;15.2.5.Final -org.infinispan:infinispan-query-core;15.2.5.Final -org.infinispan:infinispan-query-dsl;15.2.5.Final -org.infinispan:infinispan-remote-query-client;15.2.5.Final -org.infinispan:infinispan-remote-query-server;15.2.5.Final -org.infinispan:infinispan-scripting;15.2.5.Final -org.infinispan:infinispan-server-core;15.2.5.Final -org.infinispan:infinispan-server-hotrod;15.2.5.Final -org.infinispan:infinispan-server-memcached;15.2.5.Final -org.infinispan:infinispan-server-resp;15.2.5.Final -org.infinispan:infinispan-server-rest;15.2.5.Final -org.infinispan:infinispan-server-router;15.2.5.Final -org.infinispan:infinispan-server-runtime;15.2.5.Final -org.infinispan:infinispan-server-testdriver-core;15.2.5.Final -org.infinispan:infinispan-server-testdriver-junit4;15.2.5.Final -org.infinispan:infinispan-server-testdriver-junit5;15.2.5.Final -org.infinispan:infinispan-spring-boot3-starter-embedded;15.2.5.Final -org.infinispan:infinispan-spring-boot3-starter-remote;15.2.5.Final -org.infinispan:infinispan-spring6-common;15.2.5.Final -org.infinispan:infinispan-spring6-embedded;15.2.5.Final -org.infinispan:infinispan-spring6-remote;15.2.5.Final -org.infinispan:infinispan-tasks;15.2.5.Final -org.infinispan:infinispan-tasks-api;15.2.5.Final -org.infinispan:infinispan-tools;15.2.5.Final +org.infinispan:infinispan-core;15.2.6.Final +org.infinispan:infinispan-core-graalvm;15.2.6.Final +org.infinispan:infinispan-counter-api;15.2.6.Final +org.infinispan:infinispan-hibernate-cache-commons;15.2.6.Final +org.infinispan:infinispan-hibernate-cache-spi;15.2.6.Final +org.infinispan:infinispan-hibernate-cache-v62;15.2.6.Final +org.infinispan:infinispan-jboss-marshalling;15.2.6.Final +org.infinispan:infinispan-jcache;15.2.6.Final +org.infinispan:infinispan-jcache-commons;15.2.6.Final +org.infinispan:infinispan-jcache-remote;15.2.6.Final +org.infinispan:infinispan-key-value-store-client;15.2.6.Final +org.infinispan:infinispan-logging-annotations;15.2.6.Final +org.infinispan:infinispan-logging-processor;15.2.6.Final +org.infinispan:infinispan-multimap;15.2.6.Final +org.infinispan:infinispan-objectfilter;15.2.6.Final +org.infinispan:infinispan-query;15.2.6.Final +org.infinispan:infinispan-query-core;15.2.6.Final +org.infinispan:infinispan-query-dsl;15.2.6.Final +org.infinispan:infinispan-remote-query-client;15.2.6.Final +org.infinispan:infinispan-remote-query-server;15.2.6.Final +org.infinispan:infinispan-scripting;15.2.6.Final +org.infinispan:infinispan-server-core;15.2.6.Final +org.infinispan:infinispan-server-hotrod;15.2.6.Final +org.infinispan:infinispan-server-memcached;15.2.6.Final +org.infinispan:infinispan-server-resp;15.2.6.Final +org.infinispan:infinispan-server-rest;15.2.6.Final +org.infinispan:infinispan-server-router;15.2.6.Final +org.infinispan:infinispan-server-runtime;15.2.6.Final +org.infinispan:infinispan-server-testdriver-core;15.2.6.Final +org.infinispan:infinispan-server-testdriver-junit4;15.2.6.Final +org.infinispan:infinispan-server-testdriver-junit5;15.2.6.Final +org.infinispan:infinispan-spring-boot3-starter-embedded;15.2.6.Final +org.infinispan:infinispan-spring-boot3-starter-remote;15.2.6.Final +org.infinispan:infinispan-spring6-common;15.2.6.Final +org.infinispan:infinispan-spring6-embedded;15.2.6.Final +org.infinispan:infinispan-spring6-remote;15.2.6.Final +org.infinispan:infinispan-tasks;15.2.6.Final +org.infinispan:infinispan-tasks-api;15.2.6.Final +org.infinispan:infinispan-tools;15.2.6.Final org.influxdb:influxdb-java;2.25 org.jboss.logging:jboss-logging;3.6.1.Final org.jdom:jdom2;2.0.6.1 @@ -1328,11 +1328,11 @@ org.jetbrains.kotlinx:kotlinx-serialization-properties;1.6.3 org.jetbrains.kotlinx:kotlinx-serialization-properties-jvm;1.6.3 org.jetbrains.kotlinx:kotlinx-serialization-protobuf;1.6.3 org.jetbrains.kotlinx:kotlinx-serialization-protobuf-jvm;1.6.3 -org.jooq:jooq;3.19.25 -org.jooq:jooq-codegen;3.19.25 -org.jooq:jooq-codegen-maven;3.19.25 -org.jooq:jooq-kotlin;3.19.25 -org.jooq:jooq-meta;3.19.25 +org.jooq:jooq;3.19.29 +org.jooq:jooq-codegen;3.19.29 +org.jooq:jooq-codegen-maven;3.19.29 +org.jooq:jooq-kotlin;3.19.29 +org.jooq:jooq-meta;3.19.29 org.junit.jupiter:junit-jupiter;5.12.2 org.junit.jupiter:junit-jupiter-api;5.12.2 org.junit.jupiter:junit-jupiter-engine;5.12.2 @@ -1356,9 +1356,9 @@ org.jvnet.staxex:stax-ex;2.1.0 org.liquibase:liquibase-cdi;4.31.1 org.liquibase:liquibase-core;4.31.1 org.liquibase:liquibase-maven-plugin;4.31.1 -org.mariadb.jdbc:mariadb-java-client;3.5.5 +org.mariadb.jdbc:mariadb-java-client;3.5.7 org.mariadb:r2dbc-mariadb;1.3.0 -org.messaginghub:pooled-jms;3.1.7 +org.messaginghub:pooled-jms;3.1.8 org.mockito:mockito-android;5.17.0 org.mockito:mockito-bom;5.17.0 org.mockito:mockito-core;5.17.0 @@ -1366,30 +1366,30 @@ org.mockito:mockito-errorprone;5.17.0 org.mockito:mockito-junit-jupiter;5.17.0 org.mockito:mockito-proxy;5.17.0 org.mockito:mockito-subclass;5.17.0 -org.mongodb.scala:mongo-scala-bson_2.11;5.5.1 -org.mongodb.scala:mongo-scala-bson_2.12;5.5.1 -org.mongodb.scala:mongo-scala-bson_2.13;5.5.1 -org.mongodb.scala:mongo-scala-driver_2.11;5.5.1 -org.mongodb.scala:mongo-scala-driver_2.12;5.5.1 -org.mongodb.scala:mongo-scala-driver_2.13;5.5.1 -org.mongodb:bson;5.5.1 -org.mongodb:bson-kotlin;5.5.1 -org.mongodb:bson-kotlinx;5.5.1 -org.mongodb:bson-record-codec;5.5.1 -org.mongodb:mongodb-crypt;5.5.1 -org.mongodb:mongodb-driver-bom;5.5.1 -org.mongodb:mongodb-driver-core;5.5.1 -org.mongodb:mongodb-driver-kotlin-coroutine;5.5.1 -org.mongodb:mongodb-driver-kotlin-extensions;5.5.1 -org.mongodb:mongodb-driver-kotlin-sync;5.5.1 -org.mongodb:mongodb-driver-reactivestreams;5.5.1 -org.mongodb:mongodb-driver-sync;5.5.1 -org.neo4j.driver:neo4j-java-driver;5.28.9 -org.postgresql:postgresql;42.7.7 -org.postgresql:r2dbc-postgresql;1.0.7.RELEASE -org.projectlombok:lombok;1.18.38 -org.quartz-scheduler:quartz;2.5.0 -org.quartz-scheduler:quartz-jobs;2.5.0 +org.mongodb.scala:mongo-scala-bson_2.11;5.5.2 +org.mongodb.scala:mongo-scala-bson_2.12;5.5.2 +org.mongodb.scala:mongo-scala-bson_2.13;5.5.2 +org.mongodb.scala:mongo-scala-driver_2.11;5.5.2 +org.mongodb.scala:mongo-scala-driver_2.12;5.5.2 +org.mongodb.scala:mongo-scala-driver_2.13;5.5.2 +org.mongodb:bson;5.5.2 +org.mongodb:bson-kotlin;5.5.2 +org.mongodb:bson-kotlinx;5.5.2 +org.mongodb:bson-record-codec;5.5.2 +org.mongodb:mongodb-crypt;5.5.2 +org.mongodb:mongodb-driver-bom;5.5.2 +org.mongodb:mongodb-driver-core;5.5.2 +org.mongodb:mongodb-driver-kotlin-coroutine;5.5.2 +org.mongodb:mongodb-driver-kotlin-extensions;5.5.2 +org.mongodb:mongodb-driver-kotlin-sync;5.5.2 +org.mongodb:mongodb-driver-reactivestreams;5.5.2 +org.mongodb:mongodb-driver-sync;5.5.2 +org.neo4j.driver:neo4j-java-driver;5.28.10 +org.postgresql:postgresql;42.7.8 +org.postgresql:r2dbc-postgresql;1.0.9.RELEASE +org.projectlombok:lombok;1.18.42 +org.quartz-scheduler:quartz;2.5.2 +org.quartz-scheduler:quartz-jobs;2.5.2 org.reactivestreams:reactive-streams;1.0.4 org.seleniumhq.selenium:htmlunit3-driver;4.30.0 org.seleniumhq.selenium:selenium-api;4.31.0 @@ -1426,319 +1426,319 @@ org.slf4j:slf4j-reload4j;2.0.17 org.slf4j:slf4j-simple;2.0.17 org.sonatype.central:central-publishing-maven-plugin;0.7.0 org.sonatype.plugins:nexus-staging-maven-plugin;1.7.0 -org.springframework.amqp:spring-amqp;3.2.6 -org.springframework.amqp:spring-amqp-bom;3.2.6 -org.springframework.amqp:spring-rabbit;3.2.6 -org.springframework.amqp:spring-rabbit-junit;3.2.6 -org.springframework.amqp:spring-rabbit-stream;3.2.6 -org.springframework.amqp:spring-rabbit-test;3.2.6 -org.springframework.batch:spring-batch-bom;5.2.2 -org.springframework.batch:spring-batch-core;5.2.2 -org.springframework.batch:spring-batch-infrastructure;5.2.2 -org.springframework.batch:spring-batch-integration;5.2.2 -org.springframework.batch:spring-batch-test;5.2.2 -org.springframework.boot:spring-boot;3.5.5 -org.springframework.boot:spring-boot-actuator;3.5.5 -org.springframework.boot:spring-boot-actuator-autoconfigure;3.5.5 -org.springframework.boot:spring-boot-autoconfigure;3.5.5 -org.springframework.boot:spring-boot-autoconfigure-processor;3.5.5 -org.springframework.boot:spring-boot-buildpack-platform;3.5.5 -org.springframework.boot:spring-boot-configuration-metadata;3.5.5 -org.springframework.boot:spring-boot-configuration-processor;3.5.5 -org.springframework.boot:spring-boot-dependencies;3.5.5 -org.springframework.boot:spring-boot-devtools;3.5.5 -org.springframework.boot:spring-boot-docker-compose;3.5.5 -org.springframework.boot:spring-boot-jarmode-tools;3.5.5 -org.springframework.boot:spring-boot-loader;3.5.5 -org.springframework.boot:spring-boot-loader-classic;3.5.5 -org.springframework.boot:spring-boot-loader-tools;3.5.5 -org.springframework.boot:spring-boot-maven-plugin;3.5.5 -org.springframework.boot:spring-boot-properties-migrator;3.5.5 -org.springframework.boot:spring-boot-starter;3.5.5 -org.springframework.boot:spring-boot-starter-activemq;3.5.5 -org.springframework.boot:spring-boot-starter-actuator;3.5.5 -org.springframework.boot:spring-boot-starter-amqp;3.5.5 -org.springframework.boot:spring-boot-starter-aop;3.5.5 -org.springframework.boot:spring-boot-starter-artemis;3.5.5 -org.springframework.boot:spring-boot-starter-batch;3.5.5 -org.springframework.boot:spring-boot-starter-cache;3.5.5 -org.springframework.boot:spring-boot-starter-data-cassandra;3.5.5 -org.springframework.boot:spring-boot-starter-data-cassandra-reactive;3.5.5 -org.springframework.boot:spring-boot-starter-data-couchbase;3.5.5 -org.springframework.boot:spring-boot-starter-data-couchbase-reactive;3.5.5 -org.springframework.boot:spring-boot-starter-data-elasticsearch;3.5.5 -org.springframework.boot:spring-boot-starter-data-jdbc;3.5.5 -org.springframework.boot:spring-boot-starter-data-jpa;3.5.5 -org.springframework.boot:spring-boot-starter-data-ldap;3.5.5 -org.springframework.boot:spring-boot-starter-data-mongodb;3.5.5 -org.springframework.boot:spring-boot-starter-data-mongodb-reactive;3.5.5 -org.springframework.boot:spring-boot-starter-data-neo4j;3.5.5 -org.springframework.boot:spring-boot-starter-data-r2dbc;3.5.5 -org.springframework.boot:spring-boot-starter-data-redis;3.5.5 -org.springframework.boot:spring-boot-starter-data-redis-reactive;3.5.5 -org.springframework.boot:spring-boot-starter-data-rest;3.5.5 -org.springframework.boot:spring-boot-starter-freemarker;3.5.5 -org.springframework.boot:spring-boot-starter-graphql;3.5.5 -org.springframework.boot:spring-boot-starter-groovy-templates;3.5.5 -org.springframework.boot:spring-boot-starter-hateoas;3.5.5 -org.springframework.boot:spring-boot-starter-integration;3.5.5 -org.springframework.boot:spring-boot-starter-jdbc;3.5.5 -org.springframework.boot:spring-boot-starter-jersey;3.5.5 -org.springframework.boot:spring-boot-starter-jetty;3.5.5 -org.springframework.boot:spring-boot-starter-jooq;3.5.5 -org.springframework.boot:spring-boot-starter-json;3.5.5 -org.springframework.boot:spring-boot-starter-log4j2;3.5.5 -org.springframework.boot:spring-boot-starter-logging;3.5.5 -org.springframework.boot:spring-boot-starter-mail;3.5.5 -org.springframework.boot:spring-boot-starter-mustache;3.5.5 -org.springframework.boot:spring-boot-starter-oauth2-authorization-server;3.5.5 -org.springframework.boot:spring-boot-starter-oauth2-client;3.5.5 -org.springframework.boot:spring-boot-starter-oauth2-resource-server;3.5.5 -org.springframework.boot:spring-boot-starter-parent;3.5.5 -org.springframework.boot:spring-boot-starter-pulsar;3.5.5 -org.springframework.boot:spring-boot-starter-pulsar-reactive;3.5.5 -org.springframework.boot:spring-boot-starter-quartz;3.5.5 -org.springframework.boot:spring-boot-starter-reactor-netty;3.5.5 -org.springframework.boot:spring-boot-starter-rsocket;3.5.5 -org.springframework.boot:spring-boot-starter-security;3.5.5 -org.springframework.boot:spring-boot-starter-test;3.5.5 -org.springframework.boot:spring-boot-starter-thymeleaf;3.5.5 -org.springframework.boot:spring-boot-starter-tomcat;3.5.5 -org.springframework.boot:spring-boot-starter-undertow;3.5.5 -org.springframework.boot:spring-boot-starter-validation;3.5.5 -org.springframework.boot:spring-boot-starter-web;3.5.5 -org.springframework.boot:spring-boot-starter-web-services;3.5.5 -org.springframework.boot:spring-boot-starter-webflux;3.5.5 -org.springframework.boot:spring-boot-starter-websocket;3.5.5 -org.springframework.boot:spring-boot-test;3.5.5 -org.springframework.boot:spring-boot-test-autoconfigure;3.5.5 -org.springframework.boot:spring-boot-testcontainers;3.5.5 -org.springframework.cloud:spring-cloud-bus;4.3.0 -org.springframework.cloud:spring-cloud-bus-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-bus-rsocket;4.3.0 -org.springframework.cloud:spring-cloud-circuitbreaker-dependencies;3.3.0 -org.springframework.cloud:spring-cloud-circuitbreaker-resilience4j;3.3.0 -org.springframework.cloud:spring-cloud-circuitbreaker-spring-retry;3.3.0 -org.springframework.cloud:spring-cloud-commons;4.3.0 -org.springframework.cloud:spring-cloud-commons-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-config-client;4.3.0 -org.springframework.cloud:spring-cloud-config-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-config-monitor;4.3.0 -org.springframework.cloud:spring-cloud-config-server;4.3.0 -org.springframework.cloud:spring-cloud-consul-binder;4.3.0 -org.springframework.cloud:spring-cloud-consul-config;4.3.0 -org.springframework.cloud:spring-cloud-consul-core;4.3.0 -org.springframework.cloud:spring-cloud-consul-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-consul-discovery;4.3.0 -org.springframework.cloud:spring-cloud-context;4.3.0 -org.springframework.cloud:spring-cloud-contract-converters;4.3.0 -org.springframework.cloud:spring-cloud-contract-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-contract-gradle-plugin;4.3.0 -org.springframework.cloud:spring-cloud-contract-maven-plugin;4.3.0 -org.springframework.cloud:spring-cloud-contract-shade;4.3.0 -org.springframework.cloud:spring-cloud-contract-spec;4.3.0 -org.springframework.cloud:spring-cloud-contract-spec-groovy;4.3.0 -org.springframework.cloud:spring-cloud-contract-spec-java;4.3.0 -org.springframework.cloud:spring-cloud-contract-spec-kotlin;4.3.0 -org.springframework.cloud:spring-cloud-contract-stub-runner;4.3.0 -org.springframework.cloud:spring-cloud-contract-stub-runner-boot;4.3.0 -org.springframework.cloud:spring-cloud-contract-verifier;4.3.0 -org.springframework.cloud:spring-cloud-contract-wiremock;4.3.0 -org.springframework.cloud:spring-cloud-dependencies;2025.0.0 -org.springframework.cloud:spring-cloud-function-adapter-aws;4.3.0 -org.springframework.cloud:spring-cloud-function-adapter-azure;4.3.0 -org.springframework.cloud:spring-cloud-function-adapter-azure-web;4.3.0 -org.springframework.cloud:spring-cloud-function-adapter-gcp;4.3.0 -org.springframework.cloud:spring-cloud-function-context;4.3.0 -org.springframework.cloud:spring-cloud-function-core;4.3.0 -org.springframework.cloud:spring-cloud-function-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-function-deployer;4.3.0 -org.springframework.cloud:spring-cloud-function-grpc;4.3.0 -org.springframework.cloud:spring-cloud-function-grpc-cloudevent-ext;4.3.0 -org.springframework.cloud:spring-cloud-function-integration;4.3.0 -org.springframework.cloud:spring-cloud-function-kotlin;4.3.0 -org.springframework.cloud:spring-cloud-function-rsocket;4.3.0 -org.springframework.cloud:spring-cloud-function-serverless-web;4.3.0 -org.springframework.cloud:spring-cloud-function-web;4.3.0 -org.springframework.cloud:spring-cloud-gateway-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-gateway-mvc;4.3.0 -org.springframework.cloud:spring-cloud-gateway-proxyexchange-webflux;4.3.0 -org.springframework.cloud:spring-cloud-gateway-proxyexchange-webmvc;4.3.0 -org.springframework.cloud:spring-cloud-gateway-server;4.3.0 -org.springframework.cloud:spring-cloud-gateway-server-mvc;4.3.0 -org.springframework.cloud:spring-cloud-gateway-server-webflux;4.3.0 -org.springframework.cloud:spring-cloud-gateway-server-webmvc;4.3.0 -org.springframework.cloud:spring-cloud-gateway-webflux;4.3.0 -org.springframework.cloud:spring-cloud-kubernetes-client-autoconfig;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-client-config;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-client-discovery;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-client-loadbalancer;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-commons;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-dependencies;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-discovery;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-autoconfig;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-config;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-discovery;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-istio;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-leader;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-fabric8-loadbalancer;3.3.0 -org.springframework.cloud:spring-cloud-kubernetes-test-support;3.3.0 -org.springframework.cloud:spring-cloud-loadbalancer;4.3.0 -org.springframework.cloud:spring-cloud-netflix-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-netflix-eureka-client;4.3.0 -org.springframework.cloud:spring-cloud-netflix-eureka-server;4.3.0 -org.springframework.cloud:spring-cloud-openfeign-core;4.3.0 -org.springframework.cloud:spring-cloud-openfeign-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-starter;4.3.0 -org.springframework.cloud:spring-cloud-starter-bootstrap;4.3.0 -org.springframework.cloud:spring-cloud-starter-bus-amqp;4.3.0 -org.springframework.cloud:spring-cloud-starter-bus-kafka;4.3.0 -org.springframework.cloud:spring-cloud-starter-bus-stream;4.3.0 -org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j;3.3.0 -org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j;3.3.0 -org.springframework.cloud:spring-cloud-starter-circuitbreaker-spring-retry;3.3.0 -org.springframework.cloud:spring-cloud-starter-config;4.3.0 -org.springframework.cloud:spring-cloud-starter-consul;4.3.0 -org.springframework.cloud:spring-cloud-starter-consul-all;4.3.0 -org.springframework.cloud:spring-cloud-starter-consul-bus;4.3.0 -org.springframework.cloud:spring-cloud-starter-consul-config;4.3.0 -org.springframework.cloud:spring-cloud-starter-consul-discovery;4.3.0 -org.springframework.cloud:spring-cloud-starter-contract-stub-runner;4.3.0 -org.springframework.cloud:spring-cloud-starter-contract-stub-runner-jetty;4.3.0 -org.springframework.cloud:spring-cloud-starter-contract-verifier;4.3.0 -org.springframework.cloud:spring-cloud-starter-function-web;4.3.0 -org.springframework.cloud:spring-cloud-starter-function-webflux;4.3.0 -org.springframework.cloud:spring-cloud-starter-gateway;4.3.0 -org.springframework.cloud:spring-cloud-starter-gateway-mvc;4.3.0 -org.springframework.cloud:spring-cloud-starter-gateway-server-webflux;4.3.0 -org.springframework.cloud:spring-cloud-starter-gateway-server-webmvc;4.3.0 -org.springframework.cloud:spring-cloud-starter-kubernetes-client;3.3.0 -org.springframework.cloud:spring-cloud-starter-kubernetes-client-all;3.3.0 -org.springframework.cloud:spring-cloud-starter-kubernetes-client-config;3.3.0 -org.springframework.cloud:spring-cloud-starter-kubernetes-client-loadbalancer;3.3.0 -org.springframework.cloud:spring-cloud-starter-kubernetes-discoveryclient;3.3.0 -org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8;3.3.0 -org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-all;3.3.0 -org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-config;3.3.0 -org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-loadbalancer;3.3.0 -org.springframework.cloud:spring-cloud-starter-loadbalancer;4.3.0 -org.springframework.cloud:spring-cloud-starter-netflix-eureka-client;4.3.0 -org.springframework.cloud:spring-cloud-starter-netflix-eureka-server;4.3.0 -org.springframework.cloud:spring-cloud-starter-openfeign;4.3.0 -org.springframework.cloud:spring-cloud-starter-stream-kafka;4.3.0 -org.springframework.cloud:spring-cloud-starter-stream-rabbit;4.3.0 -org.springframework.cloud:spring-cloud-starter-task;3.3.0 -org.springframework.cloud:spring-cloud-starter-vault-config;4.3.0 -org.springframework.cloud:spring-cloud-starter-zookeeper;4.3.0 -org.springframework.cloud:spring-cloud-starter-zookeeper-all;4.3.0 -org.springframework.cloud:spring-cloud-starter-zookeeper-config;4.3.0 -org.springframework.cloud:spring-cloud-starter-zookeeper-discovery;4.3.0 -org.springframework.cloud:spring-cloud-stream;4.3.0 -org.springframework.cloud:spring-cloud-stream-binder-kafka;4.3.0 -org.springframework.cloud:spring-cloud-stream-binder-kafka-core;4.3.0 -org.springframework.cloud:spring-cloud-stream-binder-kafka-reactive;4.3.0 -org.springframework.cloud:spring-cloud-stream-binder-kafka-streams;4.3.0 -org.springframework.cloud:spring-cloud-stream-binder-pulsar;4.3.0 -org.springframework.cloud:spring-cloud-stream-binder-rabbit;4.3.0 -org.springframework.cloud:spring-cloud-stream-binder-rabbit-core;4.3.0 -org.springframework.cloud:spring-cloud-stream-binder-rabbit-test-support;4.3.0 -org.springframework.cloud:spring-cloud-stream-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-stream-schema-registry-client;4.3.0 -org.springframework.cloud:spring-cloud-stream-schema-registry-core;4.3.0 -org.springframework.cloud:spring-cloud-stream-schema-registry-server;4.3.0 -org.springframework.cloud:spring-cloud-stream-test-binder;4.3.0 -org.springframework.cloud:spring-cloud-stream-test-support;4.3.0 -org.springframework.cloud:spring-cloud-task-batch;3.3.0 -org.springframework.cloud:spring-cloud-task-core;3.3.0 -org.springframework.cloud:spring-cloud-task-dependencies;3.3.0 -org.springframework.cloud:spring-cloud-task-stream;3.3.0 -org.springframework.cloud:spring-cloud-test-support;4.3.0 -org.springframework.cloud:spring-cloud-vault-config;4.3.0 -org.springframework.cloud:spring-cloud-vault-config-aws;4.3.0 -org.springframework.cloud:spring-cloud-vault-config-consul;4.3.0 -org.springframework.cloud:spring-cloud-vault-config-databases;4.3.0 -org.springframework.cloud:spring-cloud-vault-config-rabbitmq;4.3.0 -org.springframework.cloud:spring-cloud-vault-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-zookeeper-config;4.3.0 -org.springframework.cloud:spring-cloud-zookeeper-core;4.3.0 -org.springframework.cloud:spring-cloud-zookeeper-dependencies;4.3.0 -org.springframework.cloud:spring-cloud-zookeeper-discovery;4.3.0 +org.springframework.amqp:spring-amqp;3.2.8 +org.springframework.amqp:spring-amqp-bom;3.2.8 +org.springframework.amqp:spring-rabbit;3.2.8 +org.springframework.amqp:spring-rabbit-junit;3.2.8 +org.springframework.amqp:spring-rabbit-stream;3.2.8 +org.springframework.amqp:spring-rabbit-test;3.2.8 +org.springframework.batch:spring-batch-bom;5.2.4 +org.springframework.batch:spring-batch-core;5.2.4 +org.springframework.batch:spring-batch-infrastructure;5.2.4 +org.springframework.batch:spring-batch-integration;5.2.4 +org.springframework.batch:spring-batch-test;5.2.4 +org.springframework.boot:spring-boot;3.5.9 +org.springframework.boot:spring-boot-actuator;3.5.9 +org.springframework.boot:spring-boot-actuator-autoconfigure;3.5.9 +org.springframework.boot:spring-boot-autoconfigure;3.5.9 +org.springframework.boot:spring-boot-autoconfigure-processor;3.5.9 +org.springframework.boot:spring-boot-buildpack-platform;3.5.9 +org.springframework.boot:spring-boot-configuration-metadata;3.5.9 +org.springframework.boot:spring-boot-configuration-processor;3.5.9 +org.springframework.boot:spring-boot-dependencies;3.5.9 +org.springframework.boot:spring-boot-devtools;3.5.9 +org.springframework.boot:spring-boot-docker-compose;3.5.9 +org.springframework.boot:spring-boot-jarmode-tools;3.5.9 +org.springframework.boot:spring-boot-loader;3.5.9 +org.springframework.boot:spring-boot-loader-classic;3.5.9 +org.springframework.boot:spring-boot-loader-tools;3.5.9 +org.springframework.boot:spring-boot-maven-plugin;3.5.9 +org.springframework.boot:spring-boot-properties-migrator;3.5.9 +org.springframework.boot:spring-boot-starter;3.5.9 +org.springframework.boot:spring-boot-starter-activemq;3.5.9 +org.springframework.boot:spring-boot-starter-actuator;3.5.9 +org.springframework.boot:spring-boot-starter-amqp;3.5.9 +org.springframework.boot:spring-boot-starter-aop;3.5.9 +org.springframework.boot:spring-boot-starter-artemis;3.5.9 +org.springframework.boot:spring-boot-starter-batch;3.5.9 +org.springframework.boot:spring-boot-starter-cache;3.5.9 +org.springframework.boot:spring-boot-starter-data-cassandra;3.5.9 +org.springframework.boot:spring-boot-starter-data-cassandra-reactive;3.5.9 +org.springframework.boot:spring-boot-starter-data-couchbase;3.5.9 +org.springframework.boot:spring-boot-starter-data-couchbase-reactive;3.5.9 +org.springframework.boot:spring-boot-starter-data-elasticsearch;3.5.9 +org.springframework.boot:spring-boot-starter-data-jdbc;3.5.9 +org.springframework.boot:spring-boot-starter-data-jpa;3.5.9 +org.springframework.boot:spring-boot-starter-data-ldap;3.5.9 +org.springframework.boot:spring-boot-starter-data-mongodb;3.5.9 +org.springframework.boot:spring-boot-starter-data-mongodb-reactive;3.5.9 +org.springframework.boot:spring-boot-starter-data-neo4j;3.5.9 +org.springframework.boot:spring-boot-starter-data-r2dbc;3.5.9 +org.springframework.boot:spring-boot-starter-data-redis;3.5.9 +org.springframework.boot:spring-boot-starter-data-redis-reactive;3.5.9 +org.springframework.boot:spring-boot-starter-data-rest;3.5.9 +org.springframework.boot:spring-boot-starter-freemarker;3.5.9 +org.springframework.boot:spring-boot-starter-graphql;3.5.9 +org.springframework.boot:spring-boot-starter-groovy-templates;3.5.9 +org.springframework.boot:spring-boot-starter-hateoas;3.5.9 +org.springframework.boot:spring-boot-starter-integration;3.5.9 +org.springframework.boot:spring-boot-starter-jdbc;3.5.9 +org.springframework.boot:spring-boot-starter-jersey;3.5.9 +org.springframework.boot:spring-boot-starter-jetty;3.5.9 +org.springframework.boot:spring-boot-starter-jooq;3.5.9 +org.springframework.boot:spring-boot-starter-json;3.5.9 +org.springframework.boot:spring-boot-starter-log4j2;3.5.9 +org.springframework.boot:spring-boot-starter-logging;3.5.9 +org.springframework.boot:spring-boot-starter-mail;3.5.9 +org.springframework.boot:spring-boot-starter-mustache;3.5.9 +org.springframework.boot:spring-boot-starter-oauth2-authorization-server;3.5.9 +org.springframework.boot:spring-boot-starter-oauth2-client;3.5.9 +org.springframework.boot:spring-boot-starter-oauth2-resource-server;3.5.9 +org.springframework.boot:spring-boot-starter-parent;3.5.9 +org.springframework.boot:spring-boot-starter-pulsar;3.5.9 +org.springframework.boot:spring-boot-starter-pulsar-reactive;3.5.9 +org.springframework.boot:spring-boot-starter-quartz;3.5.9 +org.springframework.boot:spring-boot-starter-reactor-netty;3.5.9 +org.springframework.boot:spring-boot-starter-rsocket;3.5.9 +org.springframework.boot:spring-boot-starter-security;3.5.9 +org.springframework.boot:spring-boot-starter-test;3.5.9 +org.springframework.boot:spring-boot-starter-thymeleaf;3.5.9 +org.springframework.boot:spring-boot-starter-tomcat;3.5.9 +org.springframework.boot:spring-boot-starter-undertow;3.5.9 +org.springframework.boot:spring-boot-starter-validation;3.5.9 +org.springframework.boot:spring-boot-starter-web;3.5.9 +org.springframework.boot:spring-boot-starter-web-services;3.5.9 +org.springframework.boot:spring-boot-starter-webflux;3.5.9 +org.springframework.boot:spring-boot-starter-websocket;3.5.9 +org.springframework.boot:spring-boot-test;3.5.9 +org.springframework.boot:spring-boot-test-autoconfigure;3.5.9 +org.springframework.boot:spring-boot-testcontainers;3.5.9 +org.springframework.cloud:spring-cloud-bus;4.3.1 +org.springframework.cloud:spring-cloud-bus-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-bus-rsocket;4.3.1 +org.springframework.cloud:spring-cloud-circuitbreaker-dependencies;3.3.1 +org.springframework.cloud:spring-cloud-circuitbreaker-resilience4j;3.3.1 +org.springframework.cloud:spring-cloud-circuitbreaker-spring-retry;3.3.1 +org.springframework.cloud:spring-cloud-commons;4.3.1 +org.springframework.cloud:spring-cloud-commons-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-config-client;4.3.1 +org.springframework.cloud:spring-cloud-config-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-config-monitor;4.3.1 +org.springframework.cloud:spring-cloud-config-server;4.3.1 +org.springframework.cloud:spring-cloud-consul-binder;4.3.1 +org.springframework.cloud:spring-cloud-consul-config;4.3.1 +org.springframework.cloud:spring-cloud-consul-core;4.3.1 +org.springframework.cloud:spring-cloud-consul-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-consul-discovery;4.3.1 +org.springframework.cloud:spring-cloud-context;4.3.1 +org.springframework.cloud:spring-cloud-contract-converters;4.3.1 +org.springframework.cloud:spring-cloud-contract-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-contract-gradle-plugin;4.3.1 +org.springframework.cloud:spring-cloud-contract-maven-plugin;4.3.1 +org.springframework.cloud:spring-cloud-contract-shade;4.3.1 +org.springframework.cloud:spring-cloud-contract-spec;4.3.1 +org.springframework.cloud:spring-cloud-contract-spec-groovy;4.3.1 +org.springframework.cloud:spring-cloud-contract-spec-java;4.3.1 +org.springframework.cloud:spring-cloud-contract-spec-kotlin;4.3.1 +org.springframework.cloud:spring-cloud-contract-stub-runner;4.3.1 +org.springframework.cloud:spring-cloud-contract-stub-runner-boot;4.3.1 +org.springframework.cloud:spring-cloud-contract-verifier;4.3.1 +org.springframework.cloud:spring-cloud-contract-wiremock;4.3.1 +org.springframework.cloud:spring-cloud-dependencies;2025.0.1 +org.springframework.cloud:spring-cloud-function-adapter-aws;4.3.1 +org.springframework.cloud:spring-cloud-function-adapter-azure;4.3.1 +org.springframework.cloud:spring-cloud-function-adapter-azure-web;4.3.1 +org.springframework.cloud:spring-cloud-function-adapter-gcp;4.3.1 +org.springframework.cloud:spring-cloud-function-context;4.3.1 +org.springframework.cloud:spring-cloud-function-core;4.3.1 +org.springframework.cloud:spring-cloud-function-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-function-deployer;4.3.1 +org.springframework.cloud:spring-cloud-function-grpc;4.3.1 +org.springframework.cloud:spring-cloud-function-grpc-cloudevent-ext;4.3.1 +org.springframework.cloud:spring-cloud-function-integration;4.3.1 +org.springframework.cloud:spring-cloud-function-kotlin;4.3.1 +org.springframework.cloud:spring-cloud-function-rsocket;4.3.1 +org.springframework.cloud:spring-cloud-function-serverless-web;4.3.1 +org.springframework.cloud:spring-cloud-function-web;4.3.1 +org.springframework.cloud:spring-cloud-gateway-dependencies;4.3.3 +org.springframework.cloud:spring-cloud-gateway-mvc;4.3.3 +org.springframework.cloud:spring-cloud-gateway-proxyexchange-webflux;4.3.3 +org.springframework.cloud:spring-cloud-gateway-proxyexchange-webmvc;4.3.3 +org.springframework.cloud:spring-cloud-gateway-server;4.3.3 +org.springframework.cloud:spring-cloud-gateway-server-mvc;4.3.3 +org.springframework.cloud:spring-cloud-gateway-server-webflux;4.3.3 +org.springframework.cloud:spring-cloud-gateway-server-webmvc;4.3.3 +org.springframework.cloud:spring-cloud-gateway-webflux;4.3.3 +org.springframework.cloud:spring-cloud-kubernetes-client-autoconfig;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-client-config;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-client-discovery;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-client-loadbalancer;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-commons;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-dependencies;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-discovery;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-autoconfig;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-config;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-discovery;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-istio;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-leader;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-fabric8-loadbalancer;3.3.1 +org.springframework.cloud:spring-cloud-kubernetes-test-support;3.3.1 +org.springframework.cloud:spring-cloud-loadbalancer;4.3.1 +org.springframework.cloud:spring-cloud-netflix-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-netflix-eureka-client;4.3.1 +org.springframework.cloud:spring-cloud-netflix-eureka-server;4.3.1 +org.springframework.cloud:spring-cloud-openfeign-core;4.3.1 +org.springframework.cloud:spring-cloud-openfeign-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-starter;4.3.1 +org.springframework.cloud:spring-cloud-starter-bootstrap;4.3.1 +org.springframework.cloud:spring-cloud-starter-bus-amqp;4.3.1 +org.springframework.cloud:spring-cloud-starter-bus-kafka;4.3.1 +org.springframework.cloud:spring-cloud-starter-bus-stream;4.3.1 +org.springframework.cloud:spring-cloud-starter-circuitbreaker-reactor-resilience4j;3.3.1 +org.springframework.cloud:spring-cloud-starter-circuitbreaker-resilience4j;3.3.1 +org.springframework.cloud:spring-cloud-starter-circuitbreaker-spring-retry;3.3.1 +org.springframework.cloud:spring-cloud-starter-config;4.3.1 +org.springframework.cloud:spring-cloud-starter-consul;4.3.1 +org.springframework.cloud:spring-cloud-starter-consul-all;4.3.1 +org.springframework.cloud:spring-cloud-starter-consul-bus;4.3.1 +org.springframework.cloud:spring-cloud-starter-consul-config;4.3.1 +org.springframework.cloud:spring-cloud-starter-consul-discovery;4.3.1 +org.springframework.cloud:spring-cloud-starter-contract-stub-runner;4.3.1 +org.springframework.cloud:spring-cloud-starter-contract-stub-runner-jetty;4.3.1 +org.springframework.cloud:spring-cloud-starter-contract-verifier;4.3.1 +org.springframework.cloud:spring-cloud-starter-function-web;4.3.1 +org.springframework.cloud:spring-cloud-starter-function-webflux;4.3.1 +org.springframework.cloud:spring-cloud-starter-gateway;4.3.3 +org.springframework.cloud:spring-cloud-starter-gateway-mvc;4.3.3 +org.springframework.cloud:spring-cloud-starter-gateway-server-webflux;4.3.3 +org.springframework.cloud:spring-cloud-starter-gateway-server-webmvc;4.3.3 +org.springframework.cloud:spring-cloud-starter-kubernetes-client;3.3.1 +org.springframework.cloud:spring-cloud-starter-kubernetes-client-all;3.3.1 +org.springframework.cloud:spring-cloud-starter-kubernetes-client-config;3.3.1 +org.springframework.cloud:spring-cloud-starter-kubernetes-client-loadbalancer;3.3.1 +org.springframework.cloud:spring-cloud-starter-kubernetes-discoveryclient;3.3.1 +org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8;3.3.1 +org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-all;3.3.1 +org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-config;3.3.1 +org.springframework.cloud:spring-cloud-starter-kubernetes-fabric8-loadbalancer;3.3.1 +org.springframework.cloud:spring-cloud-starter-loadbalancer;4.3.1 +org.springframework.cloud:spring-cloud-starter-netflix-eureka-client;4.3.1 +org.springframework.cloud:spring-cloud-starter-netflix-eureka-server;4.3.1 +org.springframework.cloud:spring-cloud-starter-openfeign;4.3.1 +org.springframework.cloud:spring-cloud-starter-stream-kafka;4.3.1 +org.springframework.cloud:spring-cloud-starter-stream-rabbit;4.3.1 +org.springframework.cloud:spring-cloud-starter-task;3.3.1 +org.springframework.cloud:spring-cloud-starter-vault-config;4.3.1 +org.springframework.cloud:spring-cloud-starter-zookeeper;4.3.1 +org.springframework.cloud:spring-cloud-starter-zookeeper-all;4.3.1 +org.springframework.cloud:spring-cloud-starter-zookeeper-config;4.3.1 +org.springframework.cloud:spring-cloud-starter-zookeeper-discovery;4.3.1 +org.springframework.cloud:spring-cloud-stream;4.3.1 +org.springframework.cloud:spring-cloud-stream-binder-kafka;4.3.1 +org.springframework.cloud:spring-cloud-stream-binder-kafka-core;4.3.1 +org.springframework.cloud:spring-cloud-stream-binder-kafka-reactive;4.3.1 +org.springframework.cloud:spring-cloud-stream-binder-kafka-streams;4.3.1 +org.springframework.cloud:spring-cloud-stream-binder-pulsar;4.3.1 +org.springframework.cloud:spring-cloud-stream-binder-rabbit;4.3.1 +org.springframework.cloud:spring-cloud-stream-binder-rabbit-core;4.3.1 +org.springframework.cloud:spring-cloud-stream-binder-rabbit-test-support;4.3.1 +org.springframework.cloud:spring-cloud-stream-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-stream-schema-registry-client;4.3.1 +org.springframework.cloud:spring-cloud-stream-schema-registry-core;4.3.1 +org.springframework.cloud:spring-cloud-stream-schema-registry-server;4.3.1 +org.springframework.cloud:spring-cloud-stream-test-binder;4.3.1 +org.springframework.cloud:spring-cloud-stream-test-support;4.3.1 +org.springframework.cloud:spring-cloud-task-batch;3.3.1 +org.springframework.cloud:spring-cloud-task-core;3.3.1 +org.springframework.cloud:spring-cloud-task-dependencies;3.3.1 +org.springframework.cloud:spring-cloud-task-stream;3.3.1 +org.springframework.cloud:spring-cloud-test-support;4.3.1 +org.springframework.cloud:spring-cloud-vault-config;4.3.1 +org.springframework.cloud:spring-cloud-vault-config-aws;4.3.1 +org.springframework.cloud:spring-cloud-vault-config-consul;4.3.1 +org.springframework.cloud:spring-cloud-vault-config-databases;4.3.1 +org.springframework.cloud:spring-cloud-vault-config-rabbitmq;4.3.1 +org.springframework.cloud:spring-cloud-vault-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-zookeeper-config;4.3.1 +org.springframework.cloud:spring-cloud-zookeeper-core;4.3.1 +org.springframework.cloud:spring-cloud-zookeeper-dependencies;4.3.1 +org.springframework.cloud:spring-cloud-zookeeper-discovery;4.3.1 org.springframework.credhub:spring-credhub-core;2.1.1.RELEASE -org.springframework.data:spring-data-bom;2025.0.3 -org.springframework.data:spring-data-cassandra;4.5.3 -org.springframework.data:spring-data-commons;3.5.3 -org.springframework.data:spring-data-couchbase;5.5.3 -org.springframework.data:spring-data-elasticsearch;5.5.3 -org.springframework.data:spring-data-envers;3.5.3 -org.springframework.data:spring-data-jdbc;3.5.3 -org.springframework.data:spring-data-jpa;3.5.3 -org.springframework.data:spring-data-keyvalue;3.5.3 -org.springframework.data:spring-data-ldap;3.5.3 -org.springframework.data:spring-data-mongodb;4.5.3 -org.springframework.data:spring-data-neo4j;7.5.3 -org.springframework.data:spring-data-r2dbc;3.5.3 -org.springframework.data:spring-data-redis;3.5.3 -org.springframework.data:spring-data-relational;3.5.3 -org.springframework.data:spring-data-rest-core;4.5.3 -org.springframework.data:spring-data-rest-hal-explorer;4.5.3 -org.springframework.data:spring-data-rest-webmvc;4.5.3 -org.springframework.graphql:spring-graphql;1.4.1 -org.springframework.graphql:spring-graphql-test;1.4.1 +org.springframework.data:spring-data-bom;2025.0.7 +org.springframework.data:spring-data-cassandra;4.5.7 +org.springframework.data:spring-data-commons;3.5.7 +org.springframework.data:spring-data-couchbase;5.5.7 +org.springframework.data:spring-data-elasticsearch;5.5.7 +org.springframework.data:spring-data-envers;3.5.7 +org.springframework.data:spring-data-jdbc;3.5.7 +org.springframework.data:spring-data-jpa;3.5.7 +org.springframework.data:spring-data-keyvalue;3.5.7 +org.springframework.data:spring-data-ldap;3.5.7 +org.springframework.data:spring-data-mongodb;4.5.7 +org.springframework.data:spring-data-neo4j;7.5.7 +org.springframework.data:spring-data-r2dbc;3.5.7 +org.springframework.data:spring-data-redis;3.5.7 +org.springframework.data:spring-data-relational;3.5.7 +org.springframework.data:spring-data-rest-core;4.5.7 +org.springframework.data:spring-data-rest-hal-explorer;4.5.7 +org.springframework.data:spring-data-rest-webmvc;4.5.7 +org.springframework.graphql:spring-graphql;1.4.4 +org.springframework.graphql:spring-graphql-test;1.4.4 org.springframework.hateoas:spring-hateoas;2.5.1 -org.springframework.integration:spring-integration-amqp;6.5.1 -org.springframework.integration:spring-integration-bom;6.5.1 -org.springframework.integration:spring-integration-camel;6.5.1 -org.springframework.integration:spring-integration-cassandra;6.5.1 -org.springframework.integration:spring-integration-core;6.5.1 -org.springframework.integration:spring-integration-debezium;6.5.1 -org.springframework.integration:spring-integration-event;6.5.1 -org.springframework.integration:spring-integration-feed;6.5.1 -org.springframework.integration:spring-integration-file;6.5.1 -org.springframework.integration:spring-integration-ftp;6.5.1 -org.springframework.integration:spring-integration-graphql;6.5.1 -org.springframework.integration:spring-integration-groovy;6.5.1 -org.springframework.integration:spring-integration-hazelcast;6.5.1 -org.springframework.integration:spring-integration-http;6.5.1 -org.springframework.integration:spring-integration-ip;6.5.1 -org.springframework.integration:spring-integration-jdbc;6.5.1 -org.springframework.integration:spring-integration-jms;6.5.1 -org.springframework.integration:spring-integration-jmx;6.5.1 -org.springframework.integration:spring-integration-jpa;6.5.1 -org.springframework.integration:spring-integration-kafka;6.5.1 -org.springframework.integration:spring-integration-mail;6.5.1 -org.springframework.integration:spring-integration-mongodb;6.5.1 -org.springframework.integration:spring-integration-mqtt;6.5.1 -org.springframework.integration:spring-integration-r2dbc;6.5.1 -org.springframework.integration:spring-integration-redis;6.5.1 -org.springframework.integration:spring-integration-rsocket;6.5.1 -org.springframework.integration:spring-integration-scripting;6.5.1 -org.springframework.integration:spring-integration-sftp;6.5.1 -org.springframework.integration:spring-integration-smb;6.5.1 -org.springframework.integration:spring-integration-stomp;6.5.1 -org.springframework.integration:spring-integration-stream;6.5.1 -org.springframework.integration:spring-integration-syslog;6.5.1 -org.springframework.integration:spring-integration-test;6.5.1 -org.springframework.integration:spring-integration-test-support;6.5.1 -org.springframework.integration:spring-integration-webflux;6.5.1 -org.springframework.integration:spring-integration-websocket;6.5.1 -org.springframework.integration:spring-integration-ws;6.5.1 -org.springframework.integration:spring-integration-xml;6.5.1 -org.springframework.integration:spring-integration-xmpp;6.5.1 -org.springframework.integration:spring-integration-zeromq;6.5.1 -org.springframework.integration:spring-integration-zip;6.5.1 -org.springframework.integration:spring-integration-zookeeper;6.5.1 -org.springframework.kafka:spring-kafka;3.3.9 -org.springframework.kafka:spring-kafka-test;3.3.9 -org.springframework.ldap:spring-ldap-core;3.3.3 -org.springframework.ldap:spring-ldap-ldif-core;3.3.3 -org.springframework.ldap:spring-ldap-odm;3.3.3 -org.springframework.ldap:spring-ldap-test;3.3.3 -org.springframework.pulsar:spring-pulsar;1.2.9 -org.springframework.pulsar:spring-pulsar-bom;1.2.9 -org.springframework.pulsar:spring-pulsar-cache-provider;1.2.9 -org.springframework.pulsar:spring-pulsar-cache-provider-caffeine;1.2.9 -org.springframework.pulsar:spring-pulsar-reactive;1.2.9 -org.springframework.pulsar:spring-pulsar-test;1.2.9 +org.springframework.integration:spring-integration-amqp;6.5.5 +org.springframework.integration:spring-integration-bom;6.5.5 +org.springframework.integration:spring-integration-camel;6.5.5 +org.springframework.integration:spring-integration-cassandra;6.5.5 +org.springframework.integration:spring-integration-core;6.5.5 +org.springframework.integration:spring-integration-debezium;6.5.5 +org.springframework.integration:spring-integration-event;6.5.5 +org.springframework.integration:spring-integration-feed;6.5.5 +org.springframework.integration:spring-integration-file;6.5.5 +org.springframework.integration:spring-integration-ftp;6.5.5 +org.springframework.integration:spring-integration-graphql;6.5.5 +org.springframework.integration:spring-integration-groovy;6.5.5 +org.springframework.integration:spring-integration-hazelcast;6.5.5 +org.springframework.integration:spring-integration-http;6.5.5 +org.springframework.integration:spring-integration-ip;6.5.5 +org.springframework.integration:spring-integration-jdbc;6.5.5 +org.springframework.integration:spring-integration-jms;6.5.5 +org.springframework.integration:spring-integration-jmx;6.5.5 +org.springframework.integration:spring-integration-jpa;6.5.5 +org.springframework.integration:spring-integration-kafka;6.5.5 +org.springframework.integration:spring-integration-mail;6.5.5 +org.springframework.integration:spring-integration-mongodb;6.5.5 +org.springframework.integration:spring-integration-mqtt;6.5.5 +org.springframework.integration:spring-integration-r2dbc;6.5.5 +org.springframework.integration:spring-integration-redis;6.5.5 +org.springframework.integration:spring-integration-rsocket;6.5.5 +org.springframework.integration:spring-integration-scripting;6.5.5 +org.springframework.integration:spring-integration-sftp;6.5.5 +org.springframework.integration:spring-integration-smb;6.5.5 +org.springframework.integration:spring-integration-stomp;6.5.5 +org.springframework.integration:spring-integration-stream;6.5.5 +org.springframework.integration:spring-integration-syslog;6.5.5 +org.springframework.integration:spring-integration-test;6.5.5 +org.springframework.integration:spring-integration-test-support;6.5.5 +org.springframework.integration:spring-integration-webflux;6.5.5 +org.springframework.integration:spring-integration-websocket;6.5.5 +org.springframework.integration:spring-integration-ws;6.5.5 +org.springframework.integration:spring-integration-xml;6.5.5 +org.springframework.integration:spring-integration-xmpp;6.5.5 +org.springframework.integration:spring-integration-zeromq;6.5.5 +org.springframework.integration:spring-integration-zip;6.5.5 +org.springframework.integration:spring-integration-zookeeper;6.5.5 +org.springframework.kafka:spring-kafka;3.3.11 +org.springframework.kafka:spring-kafka-test;3.3.11 +org.springframework.ldap:spring-ldap-core;3.3.5 +org.springframework.ldap:spring-ldap-ldif-core;3.3.5 +org.springframework.ldap:spring-ldap-odm;3.3.5 +org.springframework.ldap:spring-ldap-test;3.3.5 +org.springframework.pulsar:spring-pulsar;1.2.13 +org.springframework.pulsar:spring-pulsar-bom;1.2.13 +org.springframework.pulsar:spring-pulsar-cache-provider;1.2.13 +org.springframework.pulsar:spring-pulsar-cache-provider-caffeine;1.2.13 +org.springframework.pulsar:spring-pulsar-reactive;1.2.13 +org.springframework.pulsar:spring-pulsar-test;1.2.13 org.springframework.restdocs:spring-restdocs-asciidoctor;3.0.5 org.springframework.restdocs:spring-restdocs-bom;3.0.5 org.springframework.restdocs:spring-restdocs-core;3.0.5 @@ -1746,127 +1746,127 @@ org.springframework.restdocs:spring-restdocs-mockmvc;3.0.5 org.springframework.restdocs:spring-restdocs-restassured;3.0.5 org.springframework.restdocs:spring-restdocs-webtestclient;3.0.5 org.springframework.retry:spring-retry;2.0.12 -org.springframework.security:spring-security-acl;6.5.3 -org.springframework.security:spring-security-aspects;6.5.3 -org.springframework.security:spring-security-bom;6.5.3 -org.springframework.security:spring-security-cas;6.5.3 -org.springframework.security:spring-security-config;6.5.3 -org.springframework.security:spring-security-core;6.5.3 -org.springframework.security:spring-security-crypto;6.5.3 -org.springframework.security:spring-security-data;6.5.3 -org.springframework.security:spring-security-ldap;6.5.3 -org.springframework.security:spring-security-messaging;6.5.3 -org.springframework.security:spring-security-oauth2-authorization-server;1.5.2 -org.springframework.security:spring-security-oauth2-client;6.5.3 -org.springframework.security:spring-security-oauth2-core;6.5.3 -org.springframework.security:spring-security-oauth2-jose;6.5.3 -org.springframework.security:spring-security-oauth2-resource-server;6.5.3 -org.springframework.security:spring-security-rsocket;6.5.3 -org.springframework.security:spring-security-saml2-service-provider;6.5.3 -org.springframework.security:spring-security-taglibs;6.5.3 -org.springframework.security:spring-security-test;6.5.3 -org.springframework.security:spring-security-web;6.5.3 -org.springframework.session:spring-session-bom;3.5.2 -org.springframework.session:spring-session-core;3.5.2 -org.springframework.session:spring-session-data-mongodb;3.5.2 -org.springframework.session:spring-session-data-redis;3.5.2 -org.springframework.session:spring-session-hazelcast;3.5.2 -org.springframework.session:spring-session-jdbc;3.5.2 +org.springframework.security:spring-security-acl;6.5.7 +org.springframework.security:spring-security-aspects;6.5.7 +org.springframework.security:spring-security-bom;6.5.7 +org.springframework.security:spring-security-cas;6.5.7 +org.springframework.security:spring-security-config;6.5.7 +org.springframework.security:spring-security-core;6.5.7 +org.springframework.security:spring-security-crypto;6.5.7 +org.springframework.security:spring-security-data;6.5.7 +org.springframework.security:spring-security-ldap;6.5.7 +org.springframework.security:spring-security-messaging;6.5.7 +org.springframework.security:spring-security-oauth2-authorization-server;1.5.5 +org.springframework.security:spring-security-oauth2-client;6.5.7 +org.springframework.security:spring-security-oauth2-core;6.5.7 +org.springframework.security:spring-security-oauth2-jose;6.5.7 +org.springframework.security:spring-security-oauth2-resource-server;6.5.7 +org.springframework.security:spring-security-rsocket;6.5.7 +org.springframework.security:spring-security-saml2-service-provider;6.5.7 +org.springframework.security:spring-security-taglibs;6.5.7 +org.springframework.security:spring-security-test;6.5.7 +org.springframework.security:spring-security-web;6.5.7 +org.springframework.session:spring-session-bom;3.5.4 +org.springframework.session:spring-session-core;3.5.4 +org.springframework.session:spring-session-data-mongodb;3.5.4 +org.springframework.session:spring-session-data-redis;3.5.4 +org.springframework.session:spring-session-hazelcast;3.5.4 +org.springframework.session:spring-session-jdbc;3.5.4 org.springframework.vault:spring-vault-core;3.2.0 -org.springframework.ws:spring-ws-bom;4.1.1 -org.springframework.ws:spring-ws-core;4.1.1 -org.springframework.ws:spring-ws-security;4.1.1 -org.springframework.ws:spring-ws-support;4.1.1 -org.springframework.ws:spring-ws-test;4.1.1 -org.springframework.ws:spring-xml;4.1.1 -org.springframework:spring-aop;6.2.10 -org.springframework:spring-aspects;6.2.10 -org.springframework:spring-beans;6.2.10 -org.springframework:spring-context;6.2.10 -org.springframework:spring-context-indexer;6.2.10 -org.springframework:spring-context-support;6.2.10 -org.springframework:spring-core;6.2.10 -org.springframework:spring-core-test;6.2.10 -org.springframework:spring-expression;6.2.10 -org.springframework:spring-framework-bom;6.2.10 -org.springframework:spring-instrument;6.2.10 -org.springframework:spring-jcl;6.2.10 -org.springframework:spring-jdbc;6.2.10 -org.springframework:spring-jms;6.2.10 -org.springframework:spring-messaging;6.2.10 -org.springframework:spring-orm;6.2.10 -org.springframework:spring-oxm;6.2.10 -org.springframework:spring-r2dbc;6.2.10 -org.springframework:spring-test;6.2.10 -org.springframework:spring-tx;6.2.10 -org.springframework:spring-web;6.2.10 -org.springframework:spring-webflux;6.2.10 -org.springframework:spring-webmvc;6.2.10 -org.springframework:spring-websocket;6.2.10 -org.testcontainers:activemq;1.21.3 -org.testcontainers:azure;1.21.3 -org.testcontainers:cassandra;1.21.3 -org.testcontainers:chromadb;1.21.3 -org.testcontainers:clickhouse;1.21.3 -org.testcontainers:cockroachdb;1.21.3 -org.testcontainers:consul;1.21.3 -org.testcontainers:couchbase;1.21.3 -org.testcontainers:cratedb;1.21.3 -org.testcontainers:database-commons;1.21.3 -org.testcontainers:databend;1.21.3 -org.testcontainers:db2;1.21.3 -org.testcontainers:dynalite;1.21.3 -org.testcontainers:elasticsearch;1.21.3 -org.testcontainers:gcloud;1.21.3 -org.testcontainers:grafana;1.21.3 -org.testcontainers:hivemq;1.21.3 -org.testcontainers:influxdb;1.21.3 -org.testcontainers:jdbc;1.21.3 -org.testcontainers:junit-jupiter;1.21.3 -org.testcontainers:k3s;1.21.3 -org.testcontainers:k6;1.21.3 -org.testcontainers:kafka;1.21.3 -org.testcontainers:ldap;1.21.3 -org.testcontainers:localstack;1.21.3 -org.testcontainers:mariadb;1.21.3 -org.testcontainers:milvus;1.21.3 -org.testcontainers:minio;1.21.3 -org.testcontainers:mockserver;1.21.3 -org.testcontainers:mongodb;1.21.3 -org.testcontainers:mssqlserver;1.21.3 -org.testcontainers:mysql;1.21.3 -org.testcontainers:neo4j;1.21.3 -org.testcontainers:nginx;1.21.3 -org.testcontainers:oceanbase;1.21.3 -org.testcontainers:ollama;1.21.3 -org.testcontainers:openfga;1.21.3 -org.testcontainers:oracle-free;1.21.3 -org.testcontainers:oracle-xe;1.21.3 -org.testcontainers:orientdb;1.21.3 -org.testcontainers:pinecone;1.21.3 -org.testcontainers:postgresql;1.21.3 -org.testcontainers:presto;1.21.3 -org.testcontainers:pulsar;1.21.3 -org.testcontainers:qdrant;1.21.3 -org.testcontainers:questdb;1.21.3 -org.testcontainers:r2dbc;1.21.3 -org.testcontainers:rabbitmq;1.21.3 -org.testcontainers:redpanda;1.21.3 -org.testcontainers:scylladb;1.21.3 -org.testcontainers:selenium;1.21.3 -org.testcontainers:solace;1.21.3 -org.testcontainers:solr;1.21.3 -org.testcontainers:spock;1.21.3 -org.testcontainers:testcontainers;1.21.3 -org.testcontainers:testcontainers-bom;1.21.3 -org.testcontainers:tidb;1.21.3 -org.testcontainers:timeplus;1.21.3 -org.testcontainers:toxiproxy;1.21.3 -org.testcontainers:trino;1.21.3 -org.testcontainers:typesense;1.21.3 -org.testcontainers:vault;1.21.3 -org.testcontainers:weaviate;1.21.3 -org.testcontainers:yugabytedb;1.21.3 +org.springframework.ws:spring-ws-bom;4.1.2 +org.springframework.ws:spring-ws-core;4.1.2 +org.springframework.ws:spring-ws-security;4.1.2 +org.springframework.ws:spring-ws-support;4.1.2 +org.springframework.ws:spring-ws-test;4.1.2 +org.springframework.ws:spring-xml;4.1.2 +org.springframework:spring-aop;6.2.15 +org.springframework:spring-aspects;6.2.15 +org.springframework:spring-beans;6.2.15 +org.springframework:spring-context;6.2.15 +org.springframework:spring-context-indexer;6.2.15 +org.springframework:spring-context-support;6.2.15 +org.springframework:spring-core;6.2.15 +org.springframework:spring-core-test;6.2.15 +org.springframework:spring-expression;6.2.15 +org.springframework:spring-framework-bom;6.2.15 +org.springframework:spring-instrument;6.2.15 +org.springframework:spring-jcl;6.2.15 +org.springframework:spring-jdbc;6.2.15 +org.springframework:spring-jms;6.2.15 +org.springframework:spring-messaging;6.2.15 +org.springframework:spring-orm;6.2.15 +org.springframework:spring-oxm;6.2.15 +org.springframework:spring-r2dbc;6.2.15 +org.springframework:spring-test;6.2.15 +org.springframework:spring-tx;6.2.15 +org.springframework:spring-web;6.2.15 +org.springframework:spring-webflux;6.2.15 +org.springframework:spring-webmvc;6.2.15 +org.springframework:spring-websocket;6.2.15 +org.testcontainers:activemq;1.21.4 +org.testcontainers:azure;1.21.4 +org.testcontainers:cassandra;1.21.4 +org.testcontainers:chromadb;1.21.4 +org.testcontainers:clickhouse;1.21.4 +org.testcontainers:cockroachdb;1.21.4 +org.testcontainers:consul;1.21.4 +org.testcontainers:couchbase;1.21.4 +org.testcontainers:cratedb;1.21.4 +org.testcontainers:database-commons;1.21.4 +org.testcontainers:databend;1.21.4 +org.testcontainers:db2;1.21.4 +org.testcontainers:dynalite;1.21.4 +org.testcontainers:elasticsearch;1.21.4 +org.testcontainers:gcloud;1.21.4 +org.testcontainers:grafana;1.21.4 +org.testcontainers:hivemq;1.21.4 +org.testcontainers:influxdb;1.21.4 +org.testcontainers:jdbc;1.21.4 +org.testcontainers:junit-jupiter;1.21.4 +org.testcontainers:k3s;1.21.4 +org.testcontainers:k6;1.21.4 +org.testcontainers:kafka;1.21.4 +org.testcontainers:ldap;1.21.4 +org.testcontainers:localstack;1.21.4 +org.testcontainers:mariadb;1.21.4 +org.testcontainers:milvus;1.21.4 +org.testcontainers:minio;1.21.4 +org.testcontainers:mockserver;1.21.4 +org.testcontainers:mongodb;1.21.4 +org.testcontainers:mssqlserver;1.21.4 +org.testcontainers:mysql;1.21.4 +org.testcontainers:neo4j;1.21.4 +org.testcontainers:nginx;1.21.4 +org.testcontainers:oceanbase;1.21.4 +org.testcontainers:ollama;1.21.4 +org.testcontainers:openfga;1.21.4 +org.testcontainers:oracle-free;1.21.4 +org.testcontainers:oracle-xe;1.21.4 +org.testcontainers:orientdb;1.21.4 +org.testcontainers:pinecone;1.21.4 +org.testcontainers:postgresql;1.21.4 +org.testcontainers:presto;1.21.4 +org.testcontainers:pulsar;1.21.4 +org.testcontainers:qdrant;1.21.4 +org.testcontainers:questdb;1.21.4 +org.testcontainers:r2dbc;1.21.4 +org.testcontainers:rabbitmq;1.21.4 +org.testcontainers:redpanda;1.21.4 +org.testcontainers:scylladb;1.21.4 +org.testcontainers:selenium;1.21.4 +org.testcontainers:solace;1.21.4 +org.testcontainers:solr;1.21.4 +org.testcontainers:spock;1.21.4 +org.testcontainers:testcontainers;1.21.4 +org.testcontainers:testcontainers-bom;1.21.4 +org.testcontainers:tidb;1.21.4 +org.testcontainers:timeplus;1.21.4 +org.testcontainers:toxiproxy;1.21.4 +org.testcontainers:trino;1.21.4 +org.testcontainers:typesense;1.21.4 +org.testcontainers:vault;1.21.4 +org.testcontainers:weaviate;1.21.4 +org.testcontainers:yugabytedb;1.21.4 org.thymeleaf.extras:thymeleaf-extras-springsecurity6;3.1.3.RELEASE org.thymeleaf:thymeleaf;3.1.3.RELEASE org.thymeleaf:thymeleaf-spring6;3.1.3.RELEASE @@ -1874,16 +1874,16 @@ org.tmatesoft.svnkit:svnkit;1.10.11 org.vibur:vibur-dbcp;26.0 org.vibur:vibur-object-pool;26.0 org.webjars:webjars-locator-core;0.59 -org.webjars:webjars-locator-lite;1.1.0 +org.webjars:webjars-locator-lite;1.1.2 org.wiremock:wiremock-standalone;3.9.2 org.xerial:sqlite-jdbc;3.49.1.0 -org.xmlunit:xmlunit-assertj;2.10.3 -org.xmlunit:xmlunit-assertj3;2.10.3 -org.xmlunit:xmlunit-core;2.10.3 -org.xmlunit:xmlunit-jakarta-jaxb-impl;2.10.3 -org.xmlunit:xmlunit-legacy;2.10.3 -org.xmlunit:xmlunit-matchers;2.10.3 -org.xmlunit:xmlunit-placeholders;2.10.3 +org.xmlunit:xmlunit-assertj;2.10.4 +org.xmlunit:xmlunit-assertj3;2.10.4 +org.xmlunit:xmlunit-core;2.10.4 +org.xmlunit:xmlunit-jakarta-jaxb-impl;2.10.4 +org.xmlunit:xmlunit-legacy;2.10.4 +org.xmlunit:xmlunit-matchers;2.10.4 +org.xmlunit:xmlunit-placeholders;2.10.4 org.yaml:snakeyaml;2.4 redis.clients:jedis;6.0.0 wsdl4j:wsdl4j;1.6.3 diff --git a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml index 2338af63e250..875f310a4dfd 100644 --- a/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-actuator-autoconfigure/pom.xml @@ -41,13 +41,13 @@ org.springframework.boot spring-boot-actuator-autoconfigure - 3.5.5 + 3.5.9 compile com.fasterxml.jackson.core jackson-databind - 2.19.2 + 2.19.4 com.azure.spring @@ -128,7 +128,7 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -144,13 +144,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -160,7 +160,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -199,9 +199,9 @@ - com.fasterxml.jackson.core:jackson-databind:[2.19.2] - org.springframework.boot:spring-boot-actuator:[3.5.5] - org.springframework.boot:spring-boot-actuator-autoconfigure:[3.5.5] + com.fasterxml.jackson.core:jackson-databind:[2.19.4] + org.springframework.boot:spring-boot-actuator:[3.5.9] + org.springframework.boot:spring-boot-actuator-autoconfigure:[3.5.9] diff --git a/sdk/spring/spring-cloud-azure-actuator/pom.xml b/sdk/spring/spring-cloud-azure-actuator/pom.xml index 666ff849a58b..8915873326ac 100644 --- a/sdk/spring/spring-cloud-azure-actuator/pom.xml +++ b/sdk/spring/spring-cloud-azure-actuator/pom.xml @@ -45,7 +45,7 @@ org.springframework.boot spring-boot-actuator - 3.5.5 + 3.5.9 compile @@ -116,7 +116,7 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -132,13 +132,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -148,7 +148,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -184,7 +184,7 @@ - org.springframework.boot:spring-boot-actuator:[3.5.5] + org.springframework.boot:spring-boot-actuator:[3.5.9] diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml index ced190f354a2..1d0b2c2a674b 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config-web/pom.xml @@ -26,24 +26,24 @@ org.springframework.boot spring-boot-starter-web - 3.5.5 + 3.5.9 org.springframework.boot spring-boot-starter-actuator - 3.5.5 + 3.5.9 true org.springframework.cloud spring-cloud-bus - 4.3.0 + 4.3.1 true org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -59,13 +59,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -74,7 +74,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 -Xlint:deprecation @@ -118,9 +118,9 @@ - org.springframework.boot:spring-boot-starter-actuator:[3.5.5] - org.springframework.boot:spring-boot-starter-web:[3.5.5] - org.springframework.cloud:spring-cloud-bus:[4.3.0] + org.springframework.boot:spring-boot-starter-actuator:[3.5.9] + org.springframework.boot:spring-boot-starter-web:[3.5.9] + org.springframework.cloud:spring-cloud-bus:[4.3.1] diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml index 2c9630490c3d..c18070bbc3d3 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/pom.xml @@ -21,23 +21,23 @@ org.springframework.boot spring-boot-autoconfigure - 3.5.5 + 3.5.9 org.springframework.boot spring-boot-configuration-processor - 3.5.5 + 3.5.9 true org.springframework.cloud spring-cloud-context - 4.3.0 + 4.3.1 org.springframework.boot spring-boot-actuator - 3.5.5 + 3.5.9 compile @@ -80,7 +80,7 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -96,13 +96,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test + 3.14.1 -Xlint:deprecation @@ -177,13 +177,13 @@ - com.fasterxml.jackson.core:jackson-annotations:[2.19.2] - com.fasterxml.jackson.core:jackson-databind:[2.19.2] - org.springframework.boot:spring-boot-actuator:[3.5.5] - org.springframework.boot:spring-boot-autoconfigure:[3.5.5] - org.springframework.cloud:spring-cloud-context:[4.3.0] + com.fasterxml.jackson.core:jackson-annotations:[2.19.4] + com.fasterxml.jackson.core:jackson-databind:[2.19.4] + org.springframework.boot:spring-boot-actuator:[3.5.9] + org.springframework.boot:spring-boot-autoconfigure:[3.5.9] + org.springframework.cloud:spring-cloud-context:[4.3.1] jakarta.annotation:jakarta.annotation-api:[3.0.0] - org.springframework.boot:spring-boot-configuration-processor:[3.5.5] + org.springframework.boot:spring-boot-configuration-processor:[3.5.9] diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AzureAppConfigDataLocationResolver.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AzureAppConfigDataLocationResolver.java index b4ecd1b477ba..6a0ebe649ad1 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AzureAppConfigDataLocationResolver.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/main/java/com/azure/spring/cloud/appconfiguration/config/implementation/AzureAppConfigDataLocationResolver.java @@ -57,8 +57,16 @@ public boolean isResolvable(ConfigDataLocationResolverContext context, ConfigDat return false; } + Binder binder = context.getBinder(); + + // Check if Azure App Configuration is enabled + Boolean enabled = binder.bind(AppConfigurationProperties.CONFIG_PREFIX + ".enabled", Boolean.class).orElse(true); + if (!enabled) { + return false; + } + // Check if the configuration properties for Azure App Configuration are present - return hasValidStoreConfiguration(context.getBinder()); + return hasValidStoreConfiguration(binder); } /** diff --git a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AzureAppConfigDataLocationResolverTest.java b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AzureAppConfigDataLocationResolverTest.java index 04cc61b72850..a3f3655b20c7 100644 --- a/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AzureAppConfigDataLocationResolverTest.java +++ b/sdk/spring/spring-cloud-azure-appconfiguration-config/src/test/java/com/azure/spring/cloud/appconfiguration/config/implementation/AzureAppConfigDataLocationResolverTest.java @@ -47,6 +47,12 @@ class AzureAppConfigDataLocationResolverTest { @Mock BindResult validResult; + @Mock + BindResult enabledTrueResult; + + @Mock + BindResult enabledFalseResult; + private static final String PREFIX = "azureAppConfiguration:"; private static final String INVALID_PREFIX = "someOtherPrefix:"; @@ -80,6 +86,9 @@ void testIsResolvableWithCorrectPrefix() { ConfigDataLocation location = ConfigDataLocation.of(PREFIX); when(mockContext.getBinder()).thenReturn(mockBinder); + when(mockBinder.bind("spring.cloud.azure.appconfiguration.enabled", Boolean.class)) + .thenReturn(enabledTrueResult); + when(enabledTrueResult.orElse(true)).thenReturn(true); when(mockBinder.bind("spring.cloud.azure.appconfiguration.stores[0].endpoint", String.class)) .thenReturn(validResult); when(validResult.orElse("")).thenReturn("https://test.config.io"); @@ -95,6 +104,9 @@ void testIsResolvableWithValidConnectionStringConfiguration() { ConfigDataLocation location = ConfigDataLocation.of("azureAppConfiguration:"); when(mockContext.getBinder()).thenReturn(mockBinder); + when(mockBinder.bind("spring.cloud.azure.appconfiguration.enabled", Boolean.class)) + .thenReturn(enabledTrueResult); + when(enabledTrueResult.orElse(true)).thenReturn(true); when(mockBinder.bind("spring.cloud.azure.appconfiguration.stores[0].endpoint", String.class)) .thenReturn(emptyResult); when(emptyResult.orElse("")).thenReturn(""); @@ -108,11 +120,28 @@ void testIsResolvableWithValidConnectionStringConfiguration() { assertTrue(result, "Resolver should accept locations with valid connection-string configuration"); } + @Test + void testIsResolvableWhenAppConfigurationIsDisabled() { + ConfigDataLocation location = ConfigDataLocation.of("azureAppConfiguration:"); + + when(mockContext.getBinder()).thenReturn(mockBinder); + when(mockBinder.bind("spring.cloud.azure.appconfiguration.enabled", Boolean.class)) + .thenReturn(enabledFalseResult); + when(enabledFalseResult.orElse(true)).thenReturn(false); + + boolean result = resolver.isResolvable(mockContext, location); + + assertFalse(result, "Resolver should reject locations when App Configuration is disabled"); + } + @Test void testIsResolvableWithValidEndpointsConfiguration() { ConfigDataLocation location = ConfigDataLocation.of("azureAppConfiguration:"); when(mockContext.getBinder()).thenReturn(mockBinder); + when(mockBinder.bind("spring.cloud.azure.appconfiguration.enabled", Boolean.class)) + .thenReturn(enabledTrueResult); + when(enabledTrueResult.orElse(true)).thenReturn(true); when(mockBinder.bind("spring.cloud.azure.appconfiguration.stores[0].endpoint", String.class)) .thenReturn(emptyResult); when(emptyResult.orElse("")).thenReturn(""); @@ -134,6 +163,9 @@ void testIsResolvableWithValidConnectionStringsConfiguration() { ConfigDataLocation location = ConfigDataLocation.of("azureAppConfiguration:"); when(mockContext.getBinder()).thenReturn(mockBinder); + when(mockBinder.bind("spring.cloud.azure.appconfiguration.enabled", Boolean.class)) + .thenReturn(enabledTrueResult); + when(enabledTrueResult.orElse(true)).thenReturn(true); when(mockBinder.bind("spring.cloud.azure.appconfiguration.stores[0].endpoint", String.class)) .thenReturn(emptyResult); when(mockBinder.bind("spring.cloud.azure.appconfiguration.stores[0].connection-string", String.class)) @@ -156,6 +188,9 @@ void testIsResolvableWithNoValidConfiguration() { ConfigDataLocation location = ConfigDataLocation.of("azureAppConfiguration:"); when(mockContext.getBinder()).thenReturn(mockBinder); + when(mockBinder.bind("spring.cloud.azure.appconfiguration.enabled", Boolean.class)) + .thenReturn(enabledTrueResult); + when(enabledTrueResult.orElse(true)).thenReturn(true); when(mockBinder.bind("spring.cloud.azure.appconfiguration.stores[0].endpoint", String.class)) .thenReturn(emptyResult); when(mockBinder.bind("spring.cloud.azure.appconfiguration.stores[0].connection-string", String.class)) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md b/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md index b8c75ef9dc93..c5c3b19c8163 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md +++ b/sdk/spring/spring-cloud-azure-autoconfigure/CHANGELOG.md @@ -8,6 +8,8 @@ ### Bugs Fixed +- Fixed duplicate parameter issue in `AadJwtBearerGrantRequestEntityConverter` when using on_behalf_of grant type. Previously, when additional parameter converters were registered, Spring Security's `MultiValueMap.addAll()` would create duplicate values for parameters like `grant_type`, causing authentication failures with error `AADSTS70003: The app requested an unsupported grant type`. The converter now flattens multi-valued parameters to single values after all converters are processed. + ### Other Changes ## 6.1.0 (2025-12-16) diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml index e7f5403d8805..c071141b5d94 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml +++ b/sdk/spring/spring-cloud-azure-autoconfigure/pom.xml @@ -86,13 +86,13 @@ org.springframework.kafka spring-kafka - 3.3.9 + 3.3.11 true org.springframework.cloud spring-cloud-starter-stream-kafka - 4.3.0 + 4.3.1 true @@ -106,13 +106,13 @@ org.springframework.data spring-data-redis - 3.5.3 + 3.5.7 true org.springframework spring-tx - 6.2.10 + 6.2.15 true @@ -128,13 +128,13 @@ org.springframework spring-jms - 6.2.10 + 6.2.15 true org.messaginghub pooled-jms - 3.1.7 + 3.1.8 true @@ -300,25 +300,25 @@ org.springframework.boot spring-boot-autoconfigure - 3.5.5 + 3.5.9 org.springframework spring-context-support - 6.2.10 + 6.2.15 true org.springframework.boot spring-boot-actuator-autoconfigure - 3.5.5 + 3.5.9 true org.springframework.boot spring-boot-configuration-processor - 3.5.5 + 3.5.9 true @@ -326,25 +326,25 @@ org.springframework.security spring-security-oauth2-client - 6.5.3 + 6.5.7 true org.springframework.security spring-security-oauth2-resource-server - 6.5.3 + 6.5.7 true org.springframework.security spring-security-oauth2-jose - 6.5.3 + 6.5.7 true org.springframework.security spring-security-config - 6.5.3 + 6.5.7 true @@ -387,37 +387,37 @@ com.fasterxml.jackson.core jackson-databind - 2.19.2 + 2.19.4 true com.fasterxml.jackson.core jackson-core - 2.19.2 + 2.19.4 true com.fasterxml.jackson.core jackson-annotations - 2.19.2 + 2.19.4 true com.fasterxml.jackson.dataformat jackson-dataformat-xml - 2.19.2 + 2.19.4 true com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.19.2 + 2.19.4 true com.fasterxml.jackson.module jackson-module-afterburner - 2.19.2 + 2.19.4 true @@ -425,19 +425,19 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test org.springframework spring-core-test - 6.2.10 + 6.2.15 test org.springframework.boot spring-boot-configuration-metadata - 3.5.5 + 3.5.9 test @@ -453,34 +453,34 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test com.mysql mysql-connector-j - 9.4.0 + 9.5.0 test org.postgresql postgresql - 42.7.7 + 42.7.8 test org.springframework spring-jdbc - 6.2.10 + 6.2.15 test @@ -491,7 +491,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -543,33 +543,33 @@ com.azure:azure-servicebus-jms:[2.1.0] - com.mysql:mysql-connector-j:[9.4.0] - com.fasterxml.jackson.core:jackson-annotations:[2.19.2] - com.fasterxml.jackson.core:jackson-core:[2.19.2] - com.fasterxml.jackson.core:jackson-databind:[2.19.2] - com.fasterxml.jackson.dataformat:jackson-dataformat-xml:[2.19.2] - com.fasterxml.jackson.datatype:jackson-datatype-jsr310:[2.19.2] - com.fasterxml.jackson.module:jackson-module-afterburner:[2.19.2] + com.mysql:mysql-connector-j:[9.5.0] + com.fasterxml.jackson.core:jackson-annotations:[2.19.4] + com.fasterxml.jackson.core:jackson-core:[2.19.4] + com.fasterxml.jackson.core:jackson-databind:[2.19.4] + com.fasterxml.jackson.dataformat:jackson-dataformat-xml:[2.19.4] + com.fasterxml.jackson.datatype:jackson-datatype-jsr310:[2.19.4] + com.fasterxml.jackson.module:jackson-module-afterburner:[2.19.4] io.lettuce:lettuce-core:[6.6.0.RELEASE] jakarta.servlet:jakarta.servlet-api:[6.0.0] jakarta.validation:jakarta.validation-api:[3.0.2] org.hibernate.validator:hibernate-validator:[8.0.3.Final] - org.messaginghub:pooled-jms:[3.1.7] - org.postgresql:postgresql:[42.7.7] - org.springframework.boot:spring-boot-actuator-autoconfigure:[3.5.5] - org.springframework.boot:spring-boot-autoconfigure:[3.5.5] - org.springframework.boot:spring-boot-configuration-processor:[3.5.5] - org.springframework.cloud:spring-cloud-starter-stream-kafka:[4.3.0] - org.springframework.data:spring-data-redis:[3.5.3] - org.springframework.kafka:spring-kafka:[3.3.9] - org.springframework.security:spring-security-config:[6.5.3] - org.springframework.security:spring-security-oauth2-client:[6.5.3] - org.springframework.security:spring-security-oauth2-jose:[6.5.3] - org.springframework.security:spring-security-oauth2-resource-server:[6.5.3] - org.springframework:spring-context-support:[6.2.10] - org.springframework:spring-jdbc:[6.2.10] - org.springframework:spring-jms:[6.2.10] - org.springframework:spring-tx:[6.2.10] + org.messaginghub:pooled-jms:[3.1.8] + org.postgresql:postgresql:[42.7.8] + org.springframework.boot:spring-boot-actuator-autoconfigure:[3.5.9] + org.springframework.boot:spring-boot-autoconfigure:[3.5.9] + org.springframework.boot:spring-boot-configuration-processor:[3.5.9] + org.springframework.cloud:spring-cloud-starter-stream-kafka:[4.3.1] + org.springframework.data:spring-data-redis:[3.5.7] + org.springframework.kafka:spring-kafka:[3.3.11] + org.springframework.security:spring-security-config:[6.5.7] + org.springframework.security:spring-security-oauth2-client:[6.5.7] + org.springframework.security:spring-security-oauth2-jose:[6.5.7] + org.springframework.security:spring-security-oauth2-resource-server:[6.5.7] + org.springframework:spring-context-support:[6.2.15] + org.springframework:spring-jdbc:[6.2.15] + org.springframework:spring-jms:[6.2.15] + org.springframework:spring-tx:[6.2.15] diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/AadJwtBearerGrantRequestEntityConverter.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/AadJwtBearerGrantRequestEntityConverter.java index 378b13cfc165..f446d680f342 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/AadJwtBearerGrantRequestEntityConverter.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/AadJwtBearerGrantRequestEntityConverter.java @@ -3,10 +3,15 @@ package com.azure.spring.cloud.autoconfigure.implementation.aad.security; +import org.springframework.http.RequestEntity; import org.springframework.security.oauth2.client.endpoint.JwtBearerGrantRequest; import org.springframework.security.oauth2.client.endpoint.JwtBearerGrantRequestEntityConverter; +import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; +import java.util.List; +import java.util.Map; + /** * This is a special JWT Bearer flow implementation for Microsoft identify platform. * @@ -22,5 +27,41 @@ protected MultiValueMap createParameters(JwtBearerGrantRequest j parameters.add("requested_token_use", "on_behalf_of"); return parameters; } + + @Override + public RequestEntity convert(JwtBearerGrantRequest jwtBearerGrantRequest) { + // Call the parent convert() method which will run all registered parameter converters + RequestEntity requestEntity = super.convert(jwtBearerGrantRequest); + + // Get the body (parameters) from the request entity + Object body = requestEntity.getBody(); + if (!(body instanceof MultiValueMap)) { + return requestEntity; + } + + @SuppressWarnings("unchecked") + MultiValueMap parameters = (MultiValueMap) body; + + // Flatten multi-valued parameters to single values + // This fixes the issue where multiple converters add the same parameter key, + // causing duplicate values (e.g., grant_type=[value1, value2] instead of grant_type=[value1]) + MultiValueMap flattenedParameters = new LinkedMultiValueMap<>(); + for (Map.Entry> entry : parameters.entrySet()) { + List values = entry.getValue(); + if (values != null && !values.isEmpty()) { + // Use set() to ensure only one value per key + // Take the first value to preserve the base implementation's default + flattenedParameters.set(entry.getKey(), values.get(0)); + } + // Note: Parameters with null or empty value lists are intentionally excluded + // from the request, as per OAuth2 specification + } + + // Return a new RequestEntity with the flattened parameters + return RequestEntity + .method(requestEntity.getMethod(), requestEntity.getUrl()) + .headers(requestEntity.getHeaders()) + .body(flattenedParameters); + } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpoints.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpoints.java index ca5c53af3e44..d69733ee3c1f 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpoints.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpoints.java @@ -3,7 +3,7 @@ package com.azure.spring.cloud.autoconfigure.implementation.aad.security.properties; -import com.nimbusds.oauth2.sdk.util.StringUtils; +import org.springframework.util.StringUtils; /** * Used to get endpoints for Microsoft Identity authorization server. @@ -27,7 +27,7 @@ public class AadAuthorizationServerEndpoints { * @param tenantId the tenant ID */ public AadAuthorizationServerEndpoints(String baseUri, String tenantId) { - if (StringUtils.isBlank(baseUri)) { + if (!StringUtils.hasText(baseUri)) { baseUri = DEFAULT_BASE_URI; } this.baseUri = addSlash(baseUri); diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/AadJwtBearerGrantRequestEntityConverterTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/AadJwtBearerGrantRequestEntityConverterTests.java index ce771c846038..14b504676101 100644 --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/AadJwtBearerGrantRequestEntityConverterTests.java +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/AadJwtBearerGrantRequestEntityConverterTests.java @@ -10,11 +10,14 @@ import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.security.oauth2.jose.jws.JwsAlgorithms; import org.springframework.security.oauth2.jwt.Jwt; +import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import java.time.Instant; +import java.util.List; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; class AadJwtBearerGrantRequestEntityConverterTests { @@ -43,4 +46,57 @@ void requestedTokenUseParameter() { assertTrue(parameters.containsKey("requested_token_use")); assertEquals("on_behalf_of", parameters.getFirst("requested_token_use")); } + + @SuppressWarnings("unchecked") + @Test + void noDuplicateGrantTypeParameterWithAdditionalConverter() { + ClientRegistration clientRegistration = ClientRegistration.withRegistrationId("test") + .clientId("test") + .clientSecret("test-secret") + .authorizationGrantType(AuthorizationGrantType.JWT_BEARER) + .tokenUri("http://localhost/token") + .build(); + Jwt jwt = Jwt.withTokenValue("jwt-token-value") + .header("alg", JwsAlgorithms.RS256) + .claim("sub", "test") + .issuedAt(Instant.ofEpochMilli(Instant.now().toEpochMilli())) + .expiresAt(Instant.ofEpochMilli(Instant.now().plusSeconds(60).toEpochMilli())) + .build(); + JwtBearerGrantRequest request = new JwtBearerGrantRequest(clientRegistration, jwt); + AadJwtBearerGrantRequestEntityConverter converter = + new AadJwtBearerGrantRequestEntityConverter(); + + // Add a parameters converter that might set the grant_type again + // This simulates the scenario where multiple converters provide the same parameter + converter.addParametersConverter(grantRequest -> { + MultiValueMap params = new LinkedMultiValueMap<>(); + params.add("grant_type", "urn:ietf:params:oauth:grant-type:jwt-bearer"); + params.add("custom_param", "custom_value"); + return params; + }); + + RequestEntity> entity = + (RequestEntity>) converter.convert(request); + MultiValueMap parameters = entity.getBody(); + + // Verify that grant_type is present + assertTrue(parameters.containsKey("grant_type"), "grant_type parameter should be present"); + + // Verify that grant_type has only one value (not duplicated) + List grantTypeValues = parameters.get("grant_type"); + assertNotNull(grantTypeValues, "grant_type values should not be null"); + assertEquals(1, grantTypeValues.size(), + "grant_type should have exactly one value, not a list with duplicates"); + assertEquals("urn:ietf:params:oauth:grant-type:jwt-bearer", grantTypeValues.get(0), + "grant_type should have the correct value"); + + // Verify custom parameter is present + assertTrue(parameters.containsKey("custom_param"), "custom_param should be present"); + assertEquals("custom_value", parameters.getFirst("custom_param")); + + // Verify requested_token_use is present + assertTrue(parameters.containsKey("requested_token_use"), + "requested_token_use parameter should be present"); + assertEquals("on_behalf_of", parameters.getFirst("requested_token_use")); + } } diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpointsTests.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpointsTests.java new file mode 100644 index 000000000000..08ea74dc0c98 --- /dev/null +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpointsTests.java @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.spring.cloud.autoconfigure.implementation.aad.security.properties; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class AadAuthorizationServerEndpointsTests { + + private static final String DEFAULT_BASE_URI = "https://login.microsoftonline.com/"; + private static final String CUSTOM_BASE_URI = "https://custom.endpoint.com/"; + private static final String TENANT_ID = "test-tenant-id"; + + @Test + void constructorWithNullBaseUri() { + AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(null, TENANT_ID); + assertEquals(DEFAULT_BASE_URI, endpoints.getBaseUri()); + } + + @Test + void constructorWithEmptyBaseUri() { + AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints("", TENANT_ID); + assertEquals(DEFAULT_BASE_URI, endpoints.getBaseUri()); + } + + @Test + void constructorWithWhitespaceBaseUri() { + AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(" ", TENANT_ID); + assertEquals(DEFAULT_BASE_URI, endpoints.getBaseUri()); + } + + @Test + void constructorWithValidBaseUri() { + AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(CUSTOM_BASE_URI, TENANT_ID); + assertEquals(CUSTOM_BASE_URI, endpoints.getBaseUri()); + } + + @Test + void constructorWithBaseUriWithoutTrailingSlash() { + String baseUriWithoutSlash = "https://custom.endpoint.com"; + AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(baseUriWithoutSlash, TENANT_ID); + assertEquals(baseUriWithoutSlash + "/", endpoints.getBaseUri()); + } + + @Test + void getAuthorizationEndpoint() { + AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(DEFAULT_BASE_URI, TENANT_ID); + String authEndpoint = endpoints.getAuthorizationEndpoint(); + assertEquals(DEFAULT_BASE_URI + TENANT_ID + "/oauth2/v2.0/authorize", authEndpoint); + } + + @Test + void getTokenEndpoint() { + AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(DEFAULT_BASE_URI, TENANT_ID); + String tokenEndpoint = endpoints.getTokenEndpoint(); + assertEquals(DEFAULT_BASE_URI + TENANT_ID + "/oauth2/v2.0/token", tokenEndpoint); + } + + @Test + void getJwkSetEndpoint() { + AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(DEFAULT_BASE_URI, TENANT_ID); + String jwkSetEndpoint = endpoints.getJwkSetEndpoint(); + assertEquals(DEFAULT_BASE_URI + TENANT_ID + "/discovery/v2.0/keys", jwkSetEndpoint); + } + + @Test + void getEndSessionEndpoint() { + AadAuthorizationServerEndpoints endpoints = new AadAuthorizationServerEndpoints(DEFAULT_BASE_URI, TENANT_ID); + String endSessionEndpoint = endpoints.getEndSessionEndpoint(); + assertEquals(DEFAULT_BASE_URI + TENANT_ID + "/oauth2/v2.0/logout", endSessionEndpoint); + } +} diff --git a/sdk/spring/spring-cloud-azure-core/pom.xml b/sdk/spring/spring-cloud-azure-core/pom.xml index 12b4051c06ac..c4b4f064aa17 100644 --- a/sdk/spring/spring-cloud-azure-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-core/pom.xml @@ -40,7 +40,7 @@ org.springframework spring-context - 6.2.10 + 6.2.15 com.azure @@ -106,13 +106,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -124,7 +124,7 @@ org.springframework spring-test - 6.2.10 + 6.2.15 test @@ -145,7 +145,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -181,7 +181,7 @@ - org.springframework:spring-context:[6.2.10] + org.springframework:spring-context:[6.2.15] diff --git a/sdk/spring/spring-cloud-azure-docker-compose/pom.xml b/sdk/spring/spring-cloud-azure-docker-compose/pom.xml index c6935639df5d..84950b1dda4a 100644 --- a/sdk/spring/spring-cloud-azure-docker-compose/pom.xml +++ b/sdk/spring/spring-cloud-azure-docker-compose/pom.xml @@ -81,7 +81,7 @@ org.springframework.boot spring-boot-docker-compose - 3.5.5 + 3.5.9 + 3.5.9 test org.springframework spring-test - 6.2.10 + 6.2.15 test @@ -114,7 +114,7 @@ org.assertj assertj-core - 3.27.4 + 3.27.6 test @@ -124,7 +124,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -160,7 +160,7 @@ - org.springframework.boot:spring-boot-docker-compose:[3.5.5] + org.springframework.boot:spring-boot-docker-compose:[3.5.9] diff --git a/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml b/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml index 08ca28efc359..f38dc9fc038b 100644 --- a/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml +++ b/sdk/spring/spring-cloud-azure-feature-management-web/pom.xml @@ -29,12 +29,12 @@ org.springframework spring-web - 6.2.10 + 6.2.15 org.springframework spring-webmvc - 6.2.10 + 6.2.15 com.azure.spring @@ -50,20 +50,20 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -88,7 +88,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -129,8 +129,8 @@ com.azure.spring:spring-cloud-azure-feature-management:[6.2.0-beta.1] jakarta.servlet:jakarta.servlet-api:[6.0.0] - org.springframework:spring-web:[6.2.10] - org.springframework:spring-webmvc:[6.2.10] + org.springframework:spring-web:[6.2.15] + org.springframework:spring-webmvc:[6.2.15] diff --git a/sdk/spring/spring-cloud-azure-feature-management/pom.xml b/sdk/spring/spring-cloud-azure-feature-management/pom.xml index 08ae2b18f090..a2c5a21c601e 100644 --- a/sdk/spring/spring-cloud-azure-feature-management/pom.xml +++ b/sdk/spring/spring-cloud-azure-feature-management/pom.xml @@ -29,12 +29,12 @@ org.springframework spring-context - 6.2.10 + 6.2.15 org.springframework.boot spring-boot-starter - 3.5.5 + 3.5.9 ch.qos.logback @@ -45,28 +45,28 @@ org.springframework.boot spring-boot-configuration-processor - 3.5.5 + 3.5.9 true com.fasterxml.jackson.core jackson-annotations - 2.19.2 + 2.19.4 com.fasterxml.jackson.core jackson-databind - 2.19.2 + 2.19.4 io.projectreactor.netty reactor-netty - 1.2.9 + 1.2.13 org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -81,19 +81,19 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test ch.qos.logback logback-classic - 1.5.18 + 1.5.22 test @@ -118,7 +118,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -166,12 +166,12 @@ - com.fasterxml.jackson.core:jackson-annotations:[2.19.2] - com.fasterxml.jackson.core:jackson-databind:[2.19.2] - io.projectreactor.netty:reactor-netty:[1.2.9] - org.springframework.boot:spring-boot-configuration-processor:[3.5.5] - org.springframework.boot:spring-boot-starter:[3.5.5] - org.springframework:spring-context:[6.2.10] + com.fasterxml.jackson.core:jackson-annotations:[2.19.4] + com.fasterxml.jackson.core:jackson-databind:[2.19.4] + io.projectreactor.netty:reactor-netty:[1.2.13] + org.springframework.boot:spring-boot-configuration-processor:[3.5.9] + org.springframework.boot:spring-boot-starter:[3.5.9] + org.springframework:spring-context:[6.2.15] diff --git a/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml b/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml index 1458dfc78f93..d3f7b99ee089 100644 --- a/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml +++ b/sdk/spring/spring-cloud-azure-integration-test-appconfiguration-config/pom.xml @@ -6,7 +6,7 @@ org.springframework.boot spring-boot-starter-parent - 3.5.5 + 3.5.9 com.azure.spring @@ -30,7 +30,7 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -39,7 +39,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.5.3 + 3.5.4 default diff --git a/sdk/spring/spring-cloud-azure-integration-tests/pom.xml b/sdk/spring/spring-cloud-azure-integration-tests/pom.xml index 8dcd3e9f7267..4bec5f21f45f 100644 --- a/sdk/spring/spring-cloud-azure-integration-tests/pom.xml +++ b/sdk/spring/spring-cloud-azure-integration-tests/pom.xml @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-starter-parent - 3.5.5 + 3.5.9 @@ -107,7 +107,7 @@ org.springframework.cloud spring-cloud-starter-stream-kafka - 4.3.0 + 4.3.1 org.springframework.boot @@ -142,7 +142,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.5.3 + 3.5.4 default diff --git a/sdk/spring/spring-cloud-azure-integration-tests/src/test/java/com/azure/spring/cloud/integration/tests/servicebus/jms/ServiceBusJmsConnectionStringIT.java b/sdk/spring/spring-cloud-azure-integration-tests/src/test/java/com/azure/spring/cloud/integration/tests/servicebus/jms/ServiceBusJmsConnectionStringIT.java index bfafe08d71dc..2a97d3844206 100644 --- a/sdk/spring/spring-cloud-azure-integration-tests/src/test/java/com/azure/spring/cloud/integration/tests/servicebus/jms/ServiceBusJmsConnectionStringIT.java +++ b/sdk/spring/spring-cloud-azure-integration-tests/src/test/java/com/azure/spring/cloud/integration/tests/servicebus/jms/ServiceBusJmsConnectionStringIT.java @@ -2,11 +2,11 @@ // Licensed under the MIT License. package com.azure.spring.cloud.integration.tests.servicebus.jms; +import com.azure.servicebus.jms.ServiceBusJmsConnectionFactory; import jakarta.jms.ConnectionFactory; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Timeout; -import org.messaginghub.pooled.jms.JmsPoolConnectionFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -36,7 +36,7 @@ public ServiceBusJmsConnectionStringIT() { @Test @Timeout(70) void testJmsOperationViaConnStringAndCachingConnection() throws InterruptedException { - Assertions.assertSame(JmsPoolConnectionFactory.class, connectionFactory.getClass()); + Assertions.assertSame(ServiceBusJmsConnectionFactory.class, connectionFactory.getClass()); LOGGER.info("ServiceBusJmsConnectionStringIT begin."); this.exchangeMessage(jmsTemplate, CONNECTION_STRING_POOL_API_QUEUE_NAME); LOGGER.info("ServiceBusJmsConnectionStringIT end."); diff --git a/sdk/spring/spring-cloud-azure-integration-tests/src/test/resources/application-servicebus-jms-passwordless-caching.yml b/sdk/spring/spring-cloud-azure-integration-tests/src/test/resources/application-servicebus-jms-passwordless-caching.yml index 8e63cf1e26b8..2b8ca5c54cf1 100644 --- a/sdk/spring/spring-cloud-azure-integration-tests/src/test/resources/application-servicebus-jms-passwordless-caching.yml +++ b/sdk/spring/spring-cloud-azure-integration-tests/src/test/resources/application-servicebus-jms-passwordless-caching.yml @@ -4,6 +4,9 @@ spring: credential: token-credential-bean-name: integrationTestTokenCredential jms: + cache: + enabled: + true servicebus: pool: enabled: false diff --git a/sdk/spring/spring-cloud-azure-integration-tests/src/test/resources/application-servicebus-jms-passwordless-pool.yml b/sdk/spring/spring-cloud-azure-integration-tests/src/test/resources/application-servicebus-jms-passwordless-pool.yml index 4154ed97a9a5..70fbf7b20195 100644 --- a/sdk/spring/spring-cloud-azure-integration-tests/src/test/resources/application-servicebus-jms-passwordless-pool.yml +++ b/sdk/spring/spring-cloud-azure-integration-tests/src/test/resources/application-servicebus-jms-passwordless-pool.yml @@ -9,3 +9,5 @@ spring: pricing-tier: standard passwordless-enabled: true namespace: ${AZURE_SERVICE_BUS_NAMESPACE} + pool: + enabled: true diff --git a/sdk/spring/spring-cloud-azure-integration-tests/test-resources/cosmos-spring/test-resources.json b/sdk/spring/spring-cloud-azure-integration-tests/test-resources/cosmos-spring/test-resources.json index d96fc0f599fe..ae625011a033 100644 --- a/sdk/spring/spring-cloud-azure-integration-tests/test-resources/cosmos-spring/test-resources.json +++ b/sdk/spring/spring-cloud-azure-integration-tests/test-resources/cosmos-spring/test-resources.json @@ -44,7 +44,7 @@ "newAccountName": "[toLower(concat(parameters('baseName'), '2'))]", "resourceId": "[resourceId('Microsoft.DocumentDB/databaseAccounts', variables('accountName'))]", "newResourceId": "[resourceId('Microsoft.DocumentDB/databaseAccounts', variables('newAccountName'))]", - "location": "westcentralus" + "location": "[resourceGroup().location]" }, "resources": [ { diff --git a/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml b/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml index b48de2f0b228..c6bf1238587e 100644 --- a/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml +++ b/sdk/spring/spring-cloud-azure-resourcemanager/pom.xml @@ -47,7 +47,7 @@ com.azure.resourcemanager azure-resourcemanager - 2.57.0 + 2.58.0 @@ -61,13 +61,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -79,7 +79,7 @@ org.springframework spring-test - 6.2.10 + 6.2.15 test @@ -100,7 +100,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 diff --git a/sdk/spring/spring-cloud-azure-service/pom.xml b/sdk/spring/spring-cloud-azure-service/pom.xml index f2832c9d02b9..f7ea90670ae0 100644 --- a/sdk/spring/spring-cloud-azure-service/pom.xml +++ b/sdk/spring/spring-cloud-azure-service/pom.xml @@ -139,13 +139,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -157,7 +157,7 @@ org.springframework spring-test - 6.2.10 + 6.2.15 test @@ -178,7 +178,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -215,7 +215,7 @@ org.apache.kafka:kafka-clients:[3.9.1] - org.postgresql:postgresql:[42.7.7] + org.postgresql:postgresql:[42.7.8] com.nimbusds:nimbus-jose-jwt:[9.37.3] diff --git a/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml b/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml index d614306fcbe0..33043714676c 100644 --- a/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-active-directory-b2c/pom.xml @@ -95,22 +95,22 @@ org.springframework.security spring-security-config - 6.5.3 + 6.5.7 org.springframework.security spring-security-oauth2-client - 6.5.3 + 6.5.7 org.springframework.security spring-security-oauth2-jose - 6.5.3 + 6.5.7 org.springframework.security spring-security-oauth2-resource-server - 6.5.3 + 6.5.7 diff --git a/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml b/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml index 3bfe9ecba1f8..82cf340efc0f 100644 --- a/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-active-directory/pom.xml @@ -94,12 +94,12 @@ org.springframework.security spring-security-web - 6.5.3 + 6.5.7 org.springframework.security spring-security-config - 6.5.3 + 6.5.7 com.nimbusds diff --git a/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml b/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml index 569b5047ec23..60fc322fda3a 100644 --- a/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-actuator/pom.xml @@ -99,7 +99,7 @@ org.springframework.boot spring-boot-starter-actuator - 3.5.5 + 3.5.9 diff --git a/sdk/spring/spring-cloud-azure-starter-data-redis-lettuce/pom.xml b/sdk/spring/spring-cloud-azure-starter-data-redis-lettuce/pom.xml index 2c1f3fa02a96..62249a8a2d1b 100644 --- a/sdk/spring/spring-cloud-azure-starter-data-redis-lettuce/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-data-redis-lettuce/pom.xml @@ -95,7 +95,7 @@ org.springframework.data spring-data-redis - 3.5.3 + 3.5.7 diff --git a/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml index 76e71522419c..0bf486aede46 100644 --- a/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-integration-eventhubs/pom.xml @@ -95,7 +95,7 @@ org.springframework.boot spring-boot-starter-integration - 3.5.5 + 3.5.9 com.azure.spring diff --git a/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml index e29676cf2dfe..358f49a63fed 100644 --- a/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-integration-servicebus/pom.xml @@ -95,7 +95,7 @@ org.springframework.boot spring-boot-starter-integration - 3.5.5 + 3.5.9 com.azure.spring diff --git a/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml b/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml index e6b12f28487c..47a1dfc58661 100644 --- a/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-integration-storage-queue/pom.xml @@ -98,7 +98,7 @@ org.springframework.boot spring-boot-starter-integration - 3.5.5 + 3.5.9 com.azure.spring diff --git a/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml b/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml index 438cdb5d6e09..fda9453bb7fb 100644 --- a/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-jdbc-mysql/pom.xml @@ -101,7 +101,7 @@ com.mysql mysql-connector-j - 9.4.0 + 9.5.0 diff --git a/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml b/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml index 7bd5169465b0..6381368e3808 100644 --- a/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-jdbc-postgresql/pom.xml @@ -101,7 +101,7 @@ org.postgresql postgresql - 42.7.7 + 42.7.8 diff --git a/sdk/spring/spring-cloud-azure-starter-monitor-test/pom.xml b/sdk/spring/spring-cloud-azure-starter-monitor-test/pom.xml index b71e65e821cc..960fffcfa2d2 100644 --- a/sdk/spring/spring-cloud-azure-starter-monitor-test/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-monitor-test/pom.xml @@ -7,7 +7,7 @@ org.springframework.boot spring-boot-starter-parent - 3.5.5 + 3.5.9 @@ -48,17 +48,17 @@ org.springframework.boot spring-boot-starter-web - 3.5.5 + 3.5.9 org.springframework.boot spring-boot-starter-data-jdbc - 3.5.5 + 3.5.9 org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test diff --git a/sdk/spring/spring-cloud-azure-starter-monitor/pom.xml b/sdk/spring/spring-cloud-azure-starter-monitor/pom.xml index 86d98055e039..2bb90d3ff800 100644 --- a/sdk/spring/spring-cloud-azure-starter-monitor/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-monitor/pom.xml @@ -87,7 +87,7 @@ org.springframework.boot spring-boot-starter - 3.5.5 + 3.5.9 provided @@ -166,7 +166,7 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -178,7 +178,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -222,7 +222,7 @@ io.opentelemetry:opentelemetry-sdk-metrics:[1.49.0] io.opentelemetry:opentelemetry-sdk-logs:[1.49.0] io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:[1.49.0] - org.springframework.boot:spring-boot-starter:[3.5.5] + org.springframework.boot:spring-boot-starter:[3.5.9] diff --git a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml index ee79ced057a8..bbda8d72755a 100644 --- a/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter-servicebus-jms/pom.xml @@ -96,12 +96,12 @@ org.springframework spring-jms - 6.2.10 + 6.2.15 org.messaginghub pooled-jms - 3.1.7 + 3.1.8 com.azure @@ -136,37 +136,37 @@ currently released version and a lower version is resolved. --> io.netty netty-buffer - 4.1.124.Final + 4.1.130.Final io.netty netty-common - 4.1.124.Final + 4.1.130.Final io.netty netty-handler - 4.1.124.Final + 4.1.130.Final io.netty netty-transport - 4.1.124.Final + 4.1.130.Final io.netty netty-transport-native-epoll - 4.1.124.Final + 4.1.130.Final io.netty netty-transport-native-kqueue - 4.1.124.Final + 4.1.130.Final io.netty netty-codec-http - 4.1.124.Final + 4.1.130.Final com.azure diff --git a/sdk/spring/spring-cloud-azure-starter/pom.xml b/sdk/spring/spring-cloud-azure-starter/pom.xml index e8be611f8954..ee7db0cfd118 100644 --- a/sdk/spring/spring-cloud-azure-starter/pom.xml +++ b/sdk/spring/spring-cloud-azure-starter/pom.xml @@ -89,7 +89,7 @@ org.springframework.boot spring-boot-starter - 3.5.5 + 3.5.9 com.azure.spring diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml index a0d6b2ae3b1c..1ff2e3c9362d 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs-core/pom.xml @@ -47,7 +47,7 @@ spring-integration-core - 4.3.0 + 4.3.1 @@ -59,7 +59,7 @@ org.springframework.boot spring-boot-configuration-processor - 3.5.5 + 3.5.9 true @@ -74,13 +74,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -92,7 +92,7 @@ org.springframework spring-test - 6.2.10 + 6.2.15 test @@ -108,13 +108,13 @@ org.springframework.boot spring-boot-test - 3.5.5 + 3.5.9 test org.assertj assertj-core - 3.27.4 + 3.27.6 test @@ -123,7 +123,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -171,8 +171,8 @@ - org.springframework.boot:spring-boot-configuration-processor:[3.5.5] - org.springframework.cloud:spring-cloud-stream:[4.3.0] + org.springframework.boot:spring-boot-configuration-processor:[3.5.9] + org.springframework.cloud:spring-cloud-stream:[4.3.1] diff --git a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml index 9e24e4db4c7a..b66afe400605 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-eventhubs/pom.xml @@ -57,7 +57,7 @@ org.springframework.boot spring-boot-starter-actuator - 3.5.5 + 3.5.9 true @@ -70,7 +70,7 @@ org.springframework.cloud spring-cloud-stream-test-binder - 4.3.0 + 4.3.1 test @@ -82,7 +82,7 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -90,13 +90,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test + 3.14.1 @@ -162,7 +162,7 @@ - org.springframework.boot:spring-boot-starter-actuator:[3.5.5] + org.springframework.boot:spring-boot-starter-actuator:[3.5.9] diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml index 6b5e4e198fbd..8cdb01091330 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus-core/pom.xml @@ -41,7 +41,7 @@ org.springframework.cloud spring-cloud-stream - 4.3.0 + 4.3.1 @@ -57,7 +57,7 @@ org.springframework.boot spring-boot-configuration-processor - 3.5.5 + 3.5.9 true @@ -72,13 +72,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -90,7 +90,7 @@ org.springframework spring-test - 6.2.10 + 6.2.15 test @@ -106,13 +106,13 @@ org.springframework.boot spring-boot-test - 3.5.5 + 3.5.9 test org.assertj assertj-core - 3.27.4 + 3.27.6 test @@ -122,7 +122,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -170,8 +170,8 @@ - org.springframework.boot:spring-boot-configuration-processor:[3.5.5] - org.springframework.cloud:spring-cloud-stream:[4.3.0] + org.springframework.boot:spring-boot-configuration-processor:[3.5.9] + org.springframework.cloud:spring-cloud-stream:[4.3.1] diff --git a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml index 768844ec7b6e..f94a747ffcd1 100644 --- a/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml +++ b/sdk/spring/spring-cloud-azure-stream-binder-servicebus/pom.xml @@ -56,7 +56,7 @@ org.springframework.boot spring-boot-starter-actuator - 3.5.5 + 3.5.9 true + 4.3.1 test @@ -84,7 +84,7 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -100,13 +100,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -116,7 +116,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -155,7 +155,7 @@ - org.springframework.boot:spring-boot-starter-actuator:[3.5.5] + org.springframework.boot:spring-boot-starter-actuator:[3.5.9] diff --git a/sdk/spring/spring-cloud-azure-testcontainers/pom.xml b/sdk/spring/spring-cloud-azure-testcontainers/pom.xml index a80d218256a8..7678c689d72f 100644 --- a/sdk/spring/spring-cloud-azure-testcontainers/pom.xml +++ b/sdk/spring/spring-cloud-azure-testcontainers/pom.xml @@ -82,12 +82,12 @@ org.springframework.boot spring-boot-testcontainers - 3.5.5 + 3.5.9 org.testcontainers azure - 1.21.3 + 1.21.4 true + 6.2.15 test @@ -115,13 +115,13 @@ org.assertj assertj-core - 3.27.4 + 3.27.6 test org.testcontainers junit-jupiter - 1.21.3 + 1.21.4 test @@ -131,7 +131,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -167,8 +167,8 @@ - org.springframework.boot:spring-boot-testcontainers:[3.5.5] - org.testcontainers:azure:[1.21.3] + org.springframework.boot:spring-boot-testcontainers:[3.5.9] + org.testcontainers:azure:[1.21.4] diff --git a/sdk/spring/spring-integration-azure-core/pom.xml b/sdk/spring/spring-integration-azure-core/pom.xml index a551ddc6793b..f5d67a296091 100644 --- a/sdk/spring/spring-integration-azure-core/pom.xml +++ b/sdk/spring/spring-integration-azure-core/pom.xml @@ -48,7 +48,7 @@ org.springframework.integration spring-integration-core - 6.5.1 + 6.5.5 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test org.springframework spring-test - 6.2.10 + 6.2.15 test @@ -95,7 +95,7 @@ org.assertj assertj-core - 3.27.4 + 3.27.6 test @@ -105,7 +105,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -141,7 +141,7 @@ - org.springframework.integration:spring-integration-core:[6.5.1] + org.springframework.integration:spring-integration-core:[6.5.5] diff --git a/sdk/spring/spring-integration-azure-eventhubs/pom.xml b/sdk/spring/spring-integration-azure-eventhubs/pom.xml index 599ce0f025db..4ef7591f75cc 100644 --- a/sdk/spring/spring-integration-azure-eventhubs/pom.xml +++ b/sdk/spring/spring-integration-azure-eventhubs/pom.xml @@ -75,25 +75,25 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test org.springframework spring-test - 6.2.10 + 6.2.15 test org.assertj assertj-core - 3.27.4 + 3.27.6 test @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 diff --git a/sdk/spring/spring-integration-azure-servicebus/pom.xml b/sdk/spring/spring-integration-azure-servicebus/pom.xml index d5632f3ab430..0e77135dc783 100644 --- a/sdk/spring/spring-integration-azure-servicebus/pom.xml +++ b/sdk/spring/spring-integration-azure-servicebus/pom.xml @@ -74,13 +74,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -92,13 +92,13 @@ org.springframework spring-test - 6.2.10 + 6.2.15 test org.assertj assertj-core - 3.27.4 + 3.27.6 test @@ -108,7 +108,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 diff --git a/sdk/spring/spring-integration-azure-storage-queue/pom.xml b/sdk/spring/spring-integration-azure-storage-queue/pom.xml index 680003b60bc9..3e932a2d0734 100644 --- a/sdk/spring/spring-integration-azure-storage-queue/pom.xml +++ b/sdk/spring/spring-integration-azure-storage-queue/pom.xml @@ -71,13 +71,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -93,7 +93,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 diff --git a/sdk/spring/spring-messaging-azure-eventhubs/pom.xml b/sdk/spring/spring-messaging-azure-eventhubs/pom.xml index c7dd8baf7e34..d243f79436a3 100644 --- a/sdk/spring/spring-messaging-azure-eventhubs/pom.xml +++ b/sdk/spring/spring-messaging-azure-eventhubs/pom.xml @@ -59,7 +59,7 @@ org.springframework spring-tx - 6.2.10 + 6.2.15 true @@ -71,7 +71,7 @@ org.springframework.data spring-data-commons - 3.5.3 + 3.5.7 org.slf4j @@ -83,7 +83,7 @@ io.micrometer micrometer-core - 1.15.3 + 1.15.7 true @@ -97,7 +97,7 @@ org.springframework spring-test - 6.2.10 + 6.2.15 test @@ -111,13 +111,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -129,7 +129,7 @@ io.projectreactor reactor-test - 3.7.9 + 3.7.14 test @@ -138,7 +138,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -174,10 +174,10 @@ - io.micrometer:micrometer-core:[1.15.3] - org.springframework:spring-tx:[6.2.10] + io.micrometer:micrometer-core:[1.15.7] + org.springframework:spring-tx:[6.2.15] org.springframework.retry:spring-retry:[2.0.12] - org.springframework.data:spring-data-commons:[3.5.3] + org.springframework.data:spring-data-commons:[3.5.7] diff --git a/sdk/spring/spring-messaging-azure-servicebus/pom.xml b/sdk/spring/spring-messaging-azure-servicebus/pom.xml index fcb2dbf0e6cb..4e40e2175938 100644 --- a/sdk/spring/spring-messaging-azure-servicebus/pom.xml +++ b/sdk/spring/spring-messaging-azure-servicebus/pom.xml @@ -52,7 +52,7 @@ org.springframework spring-tx - 6.2.10 + 6.2.15 true @@ -64,7 +64,7 @@ org.springframework.data spring-data-commons - 3.5.3 + 3.5.7 org.slf4j @@ -76,7 +76,7 @@ io.micrometer micrometer-core - 1.15.3 + 1.15.7 true @@ -90,13 +90,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -123,7 +123,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -159,10 +159,10 @@ - io.micrometer:micrometer-core:[1.15.3] - org.springframework:spring-tx:[6.2.10] + io.micrometer:micrometer-core:[1.15.7] + org.springframework:spring-tx:[6.2.15] org.springframework.retry:spring-retry:[2.0.12] - org.springframework.data:spring-data-commons:[3.5.3] + org.springframework.data:spring-data-commons:[3.5.7] diff --git a/sdk/spring/spring-messaging-azure-storage-queue/pom.xml b/sdk/spring/spring-messaging-azure-storage-queue/pom.xml index 22f51251a3a5..3a966d53e97d 100644 --- a/sdk/spring/spring-messaging-azure-storage-queue/pom.xml +++ b/sdk/spring/spring-messaging-azure-storage-queue/pom.xml @@ -60,13 +60,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -78,7 +78,7 @@ org.springframework.boot spring-boot-starter-test - 3.5.5 + 3.5.9 test @@ -100,7 +100,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 diff --git a/sdk/spring/spring-messaging-azure/pom.xml b/sdk/spring/spring-messaging-azure/pom.xml index 06ef9717ad60..1f365341b933 100644 --- a/sdk/spring/spring-messaging-azure/pom.xml +++ b/sdk/spring/spring-messaging-azure/pom.xml @@ -46,12 +46,12 @@ org.springframework spring-messaging - 6.2.10 + 6.2.15 org.springframework spring-tx - 6.2.10 + 6.2.15 true @@ -63,7 +63,7 @@ org.springframework.data spring-data-commons - 3.5.3 + 3.5.7 org.slf4j @@ -75,7 +75,7 @@ io.micrometer micrometer-core - 1.15.3 + 1.15.7 true + 3.5.9 test @@ -107,13 +107,13 @@ net.bytebuddy byte-buddy - 1.17.7 + 1.17.8 test net.bytebuddy byte-buddy-agent - 1.17.7 + 1.17.8 test @@ -123,7 +123,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.14.0 + 3.14.1 @@ -159,10 +159,10 @@ - io.micrometer:micrometer-core:[1.15.3] - org.springframework.data:spring-data-commons:[3.5.3] - org.springframework:spring-messaging:[6.2.10] - org.springframework:spring-tx:[6.2.10] + io.micrometer:micrometer-core:[1.15.7] + org.springframework.data:spring-data-commons:[3.5.7] + org.springframework:spring-messaging:[6.2.15] + org.springframework:spring-tx:[6.2.15] org.springframework.retry:spring-retry:[2.0.12] diff --git a/sdk/subscription/azure-resourcemanager-subscription/CHANGELOG.md b/sdk/subscription/azure-resourcemanager-subscription/CHANGELOG.md index 24adf4386ed8..7c16f0776537 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/CHANGELOG.md +++ b/sdk/subscription/azure-resourcemanager-subscription/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.1.0-beta.1 (Unreleased) +## 1.1.0-beta.2 (Unreleased) ### Features Added @@ -10,6 +10,199 @@ ### Other Changes +## 1.1.0-beta.1 (2026-01-08) + +- Azure Resource Manager Subscription client library for Java. This package contains Microsoft Azure SDK for Subscription Management SDK. The subscription client. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Changes + +#### `models.PutAliasResponse` was removed + +#### `models.TenantIdDescription` was removed + +#### `models.Subscription` was removed + +#### `models.PutAliasListResult` was removed + +#### `models.SubscriptionState` was removed + +#### `models.Tenants` was removed + +#### `models.SpendingLimit` was removed + +#### `models.SubscriptionListResult` was removed + +#### `models.LocationListResult` was removed + +#### `models.TenantListResult` was removed + +#### `models.PutAliasResponseProperties` was removed + +#### `models.Location` was removed + +#### `models.Operation` was modified + +* `Operation()` was removed +* `validate()` was removed +* `withDisplay(models.OperationDisplay)` was removed +* `models.OperationDisplay display()` -> `models.OperationDisplay display()` +* `withName(java.lang.String)` was removed +* `java.lang.String name()` -> `java.lang.String name()` +* `fromJson(com.azure.json.JsonReader)` was removed +* `toJson(com.azure.json.JsonWriter)` was removed + +#### `models.Subscriptions` was modified + +* `listLocations(java.lang.String,com.azure.core.util.Context)` was removed +* `list()` was removed +* `get(java.lang.String)` was removed +* `list(com.azure.core.util.Context)` was removed +* `getWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `listLocations(java.lang.String)` was removed + +#### `models.Alias` was modified + +* `models.PutAliasResponse create(java.lang.String,models.PutAliasRequest)` -> `models.SubscriptionAliasResponse create(java.lang.String,models.PutAliasRequest)` +* `models.PutAliasResponse get(java.lang.String)` -> `models.SubscriptionAliasResponse get(java.lang.String)` +* `models.PutAliasListResult list()` -> `models.SubscriptionAliasListResult list()` +* `models.PutAliasResponse create(java.lang.String,models.PutAliasRequest,com.azure.core.util.Context)` -> `models.SubscriptionAliasResponse create(java.lang.String,models.PutAliasRequest,com.azure.core.util.Context)` + +#### `models.Operations` was modified + +* `listWithResponse(com.azure.core.util.Context)` was removed +* `models.OperationListResult list()` -> `com.azure.core.http.rest.PagedIterable list()` + +#### `models.SubscriptionPolicies` was modified + +* `SubscriptionPolicies()` was removed +* `locationPlacementId()` was removed +* `toJson(com.azure.json.JsonWriter)` was removed +* `validate()` was removed +* `quotaId()` was removed +* `spendingLimit()` was removed +* `fromJson(com.azure.json.JsonReader)` was removed + +#### `models.OperationListResult` was modified + +* `java.lang.String nextLink()` -> `java.lang.String nextLink()` +* `java.util.List value()` -> `java.util.List value()` +* `innerModel()` was removed + +#### `SubscriptionManager` was modified + +* `tenants()` was removed + +#### `models.SubscriptionOperations` was modified + +* `cancelWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `rename(java.lang.String,models.SubscriptionName)` was removed +* `enable(java.lang.String)` was removed +* `enableWithResponse(java.lang.String,com.azure.core.util.Context)` was removed +* `cancel(java.lang.String)` was removed +* `renameWithResponse(java.lang.String,models.SubscriptionName,com.azure.core.util.Context)` was removed + +### Features Added + +* `models.TenantPolicy` was added + +* `models.GetTenantPolicyResponse` was added + +* `models.BillingAccountPoliciesResponse` was added + +* `models.ServiceTenantResponse` was added + +* `models.AcceptOwnershipRequest` was added + +* `models.SubscriptionAliasResponseProperties` was added + +* `models.PutAliasRequestAdditionalProperties` was added + +* `models.AcceptOwnershipRequestProperties` was added + +* `models.SubscriptionOperationsGetHeaders` was added + +* `models.SubscriptionAliasResponse` was added + +* `models.SubscriptionAliasListResult` was added + +* `models.GetTenantPolicyListResponse` was added + +* `models.BillingAccounts` was added + +* `models.SubscriptionOperationsGetResponse` was added + +* `models.BillingAccountPoliciesResponseProperties` was added + +* `models.PutTenantPolicyRequestProperties` was added + +* `models.SubscriptionCreationResult` was added + +* `models.Provisioning` was added + +* `models.AcceptOwnershipStatusResponse` was added + +* `models.AcceptOwnership` was added + +#### `models.Operation` was modified + +* `innerModel()` was added +* `isDataAction()` was added + +#### `models.PutAliasRequestProperties` was modified + +* `withAdditionalProperties(models.PutAliasRequestAdditionalProperties)` was added +* `additionalProperties()` was added + +#### `models.Subscriptions` was modified + +* `cancel(java.lang.String)` was added +* `enable(java.lang.String)` was added +* `acceptOwnershipStatus(java.lang.String)` was added +* `enableWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `renameWithResponse(java.lang.String,models.SubscriptionName,com.azure.core.util.Context)` was added +* `cancelWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `acceptOwnershipStatusWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `rename(java.lang.String,models.SubscriptionName)` was added +* `acceptOwnership(java.lang.String,models.AcceptOwnershipRequest,com.azure.core.util.Context)` was added +* `acceptOwnership(java.lang.String,models.AcceptOwnershipRequest)` was added + +#### `models.Operations` was modified + +* `list(com.azure.core.util.Context)` was added + +#### `models.OperationDisplay` was modified + +* `description()` was added +* `withDescription(java.lang.String)` was added + +#### `models.SubscriptionPolicies` was modified + +* `getPolicyForTenant()` was added +* `addUpdatePolicyForTenant(models.PutTenantPolicyRequestProperties)` was added +* `listPolicyForTenant()` was added +* `addUpdatePolicyForTenantWithResponse(models.PutTenantPolicyRequestProperties,com.azure.core.util.Context)` was added +* `listPolicyForTenant(com.azure.core.util.Context)` was added +* `getPolicyForTenantWithResponse(com.azure.core.util.Context)` was added + +#### `models.OperationListResult` was modified + +* `OperationListResult()` was added +* `toJson(com.azure.json.JsonWriter)` was added +* `validate()` was added +* `withNextLink(java.lang.String)` was added +* `fromJson(com.azure.json.JsonReader)` was added +* `withValue(java.util.List)` was added + +#### `SubscriptionManager` was modified + +* `billingAccounts()` was added +* `subscriptionPolicies()` was added + +#### `models.SubscriptionOperations` was modified + +* `getWithResponse(java.lang.String,com.azure.core.util.Context)` was added +* `get(java.lang.String)` was added + ## 1.0.0 (2024-12-25) - Azure Resource Manager Subscription client library for Java. This package contains Microsoft Azure SDK for Subscription Management SDK. The subscription client. Package tag package-2020-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). diff --git a/sdk/subscription/azure-resourcemanager-subscription/README.md b/sdk/subscription/azure-resourcemanager-subscription/README.md index 9737d6f43586..0dbf29a378d0 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/README.md +++ b/sdk/subscription/azure-resourcemanager-subscription/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Subscription client library for Java. -This package contains Microsoft Azure SDK for Subscription Management SDK. The subscription client. Package tag package-2020-09. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). +This package contains Microsoft Azure SDK for Subscription Management SDK. The subscription client. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -52,7 +52,7 @@ Azure subscription ID can be configured via `AZURE_SUBSCRIPTION_ID` environment Assuming the use of the `DefaultAzureCredential` credential class, the client can be authenticated using the following code: ```java -AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE); +AzureProfile profile = new AzureProfile(AzureCloud.AZURE_PUBLIC_CLOUD); TokenCredential credential = new DefaultAzureCredentialBuilder() .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint()) .build(); @@ -60,7 +60,7 @@ SubscriptionManager manager = SubscriptionManager .authenticate(credential, profile); ``` -The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise. +The sample code assumes global Azure. Please change the `AzureCloud.AZURE_PUBLIC_CLOUD` variable if otherwise. See [Authentication][authenticate] for more options. @@ -100,5 +100,3 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m [cg]: https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md [coc]: https://opensource.microsoft.com/codeofconduct/ [coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ - - diff --git a/sdk/subscription/azure-resourcemanager-subscription/SAMPLE.md b/sdk/subscription/azure-resourcemanager-subscription/SAMPLE.md index b56981995cd6..df78d86dbb86 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/SAMPLE.md +++ b/sdk/subscription/azure-resourcemanager-subscription/SAMPLE.md @@ -8,31 +8,40 @@ - [Get](#alias_get) - [List](#alias_list) +## BillingAccount + +- [GetPolicy](#billingaccount_getpolicy) + ## Operations - [List](#operations_list) -## SubscriptionOperation +## Subscription -- [Cancel](#subscriptionoperation_cancel) -- [Enable](#subscriptionoperation_enable) -- [Rename](#subscriptionoperation_rename) +- [AcceptOwnership](#subscription_acceptownership) +- [AcceptOwnershipStatus](#subscription_acceptownershipstatus) +- [Cancel](#subscription_cancel) +- [Enable](#subscription_enable) +- [Rename](#subscription_rename) -## Subscriptions +## SubscriptionOperation -- [Get](#subscriptions_get) -- [List](#subscriptions_list) -- [ListLocations](#subscriptions_listlocations) +- [Get](#subscriptionoperation_get) -## Tenants +## SubscriptionPolicy -- [List](#tenants_list) +- [AddUpdatePolicyForTenant](#subscriptionpolicy_addupdatepolicyfortenant) +- [GetPolicyForTenant](#subscriptionpolicy_getpolicyfortenant) +- [ListPolicyForTenant](#subscriptionpolicy_listpolicyfortenant) ### Alias_Create ```java import com.azure.resourcemanager.subscription.models.PutAliasRequest; +import com.azure.resourcemanager.subscription.models.PutAliasRequestAdditionalProperties; import com.azure.resourcemanager.subscription.models.PutAliasRequestProperties; import com.azure.resourcemanager.subscription.models.Workload; +import java.util.HashMap; +import java.util.Map; /** * Samples for Alias Create. @@ -40,7 +49,7 @@ import com.azure.resourcemanager.subscription.models.Workload; public final class AliasCreateSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/createAlias.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/createAlias.json */ /** * Sample code: CreateAlias. @@ -50,12 +59,28 @@ public final class AliasCreateSamples { public static void createAlias(com.azure.resourcemanager.subscription.SubscriptionManager manager) { manager.alias() .create("aliasForNewSub", new PutAliasRequest().withProperties(new PutAliasRequestProperties() - .withDisplayName("Contoso MCA subscription") + .withDisplayName("Test Subscription") .withWorkload(Workload.PRODUCTION) .withBillingScope( - "/providers/Microsoft.Billing/billingAccounts/e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31/billingProfiles/PE2Q-NOIT-BG7-TGB/invoiceSections/MTT4-OBS7-PJA-TGB")), + "/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH") + .withAdditionalProperties(new PutAliasRequestAdditionalProperties() + .withSubscriptionTenantId("66f6e4d6-07dc-4aea-94ea-e12d3026a3c8") + .withSubscriptionOwnerId("f09b39eb-c496-482c-9ab9-afd799572f4c") + .withTags(mapOf("tag1", "Messi", "tag2", "Ronaldo", "tag3", "Lebron")))), 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; + } } ``` @@ -68,7 +93,7 @@ public final class AliasCreateSamples { public final class AliasDeleteSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/deleteAlias.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.json */ /** * Sample code: DeleteAlias. @@ -90,7 +115,7 @@ public final class AliasDeleteSamples { public final class AliasGetSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/getAlias.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getAlias.json */ /** * Sample code: GetAlias. @@ -112,19 +137,42 @@ public final class AliasGetSamples { public final class AliasListSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/listAlias.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/listAlias.json */ /** - * Sample code: GetAlias. + * Sample code: ListAlias. * * @param manager Entry point to SubscriptionManager. */ - public static void getAlias(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + public static void listAlias(com.azure.resourcemanager.subscription.SubscriptionManager manager) { manager.alias().listWithResponse(com.azure.core.util.Context.NONE); } } ``` +### BillingAccount_GetPolicy + +```java +/** + * Samples for BillingAccount GetPolicy. + */ +public final class BillingAccountGetPolicySamples { + /* + * x-ms-original-file: + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/ + * getBillingAccountPolicy.json + */ + /** + * Sample code: GetBillingAccountPolicy. + * + * @param manager Entry point to SubscriptionManager. + */ + public static void getBillingAccountPolicy(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.billingAccounts().getPolicyWithResponse("testBillingAccountId", com.azure.core.util.Context.NONE); + } +} +``` + ### Operations_List ```java @@ -134,7 +182,7 @@ public final class AliasListSamples { public final class OperationsListSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/getOperations.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getOperations.json */ /** * Sample code: getOperations. @@ -142,21 +190,91 @@ public final class OperationsListSamples { * @param manager Entry point to SubscriptionManager. */ public static void getOperations(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); + } +} +``` + +### Subscription_AcceptOwnership + +```java +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequest; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequestProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Subscription AcceptOwnership. + */ +public final class SubscriptionAcceptOwnershipSamples { + /* + * x-ms-original-file: + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/ + * acceptSubscriptionOwnership.json + */ + /** + * Sample code: AcceptOwnership. + * + * @param manager Entry point to SubscriptionManager. + */ + public static void acceptOwnership(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptions() + .acceptOwnership("291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + new AcceptOwnershipRequest() + .withProperties(new AcceptOwnershipRequestProperties().withDisplayName("Test Subscription") + .withTags(mapOf("tag1", "Messi", "tag2", "Ronaldo", "tag3", "Lebron"))), + 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; + } +} +``` + +### Subscription_AcceptOwnershipStatus + +```java +/** + * Samples for Subscription AcceptOwnershipStatus. + */ +public final class SubscriptionAcceptOwnershipStatusSamples { + /* + * x-ms-original-file: + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/ + * acceptOwnershipStatus.json + */ + /** + * Sample code: AcceptOwnershipStatus. + * + * @param manager Entry point to SubscriptionManager. + */ + public static void acceptOwnershipStatus(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptions() + .acceptOwnershipStatusWithResponse("291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + com.azure.core.util.Context.NONE); } } ``` -### SubscriptionOperation_Cancel +### Subscription_Cancel ```java /** - * Samples for SubscriptionOperation Cancel. + * Samples for Subscription Cancel. */ -public final class SubscriptionOperationCancelSamples { +public final class SubscriptionCancelSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/cancelSubscription. + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/cancelSubscription. * json */ /** @@ -165,22 +283,22 @@ public final class SubscriptionOperationCancelSamples { * @param manager Entry point to SubscriptionManager. */ public static void cancelSubscription(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptionOperations() + manager.subscriptions() .cancelWithResponse("83aa47df-e3e9-49ff-877b-94304bf3d3ad", com.azure.core.util.Context.NONE); } } ``` -### SubscriptionOperation_Enable +### Subscription_Enable ```java /** - * Samples for SubscriptionOperation Enable. + * Samples for Subscription Enable. */ -public final class SubscriptionOperationEnableSamples { +public final class SubscriptionEnableSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/enableSubscription. + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/enableSubscription. * json */ /** @@ -189,24 +307,24 @@ public final class SubscriptionOperationEnableSamples { * @param manager Entry point to SubscriptionManager. */ public static void enableSubscription(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptionOperations() + manager.subscriptions() .enableWithResponse("7948bcee-488c-47ce-941c-38e20ede803d", com.azure.core.util.Context.NONE); } } ``` -### SubscriptionOperation_Rename +### Subscription_Rename ```java import com.azure.resourcemanager.subscription.models.SubscriptionName; /** - * Samples for SubscriptionOperation Rename. + * Samples for Subscription Rename. */ -public final class SubscriptionOperationRenameSamples { +public final class SubscriptionRenameSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/renameSubscription. + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/renameSubscription. * json */ /** @@ -215,100 +333,113 @@ public final class SubscriptionOperationRenameSamples { * @param manager Entry point to SubscriptionManager. */ public static void renameSubscription(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptionOperations() + manager.subscriptions() .renameWithResponse("83aa47df-e3e9-49ff-877b-94304bf3d3ad", new SubscriptionName().withSubscriptionName("Test Sub"), com.azure.core.util.Context.NONE); } } ``` -### Subscriptions_Get +### SubscriptionOperation_Get ```java /** - * Samples for Subscriptions Get. + * Samples for SubscriptionOperation Get. */ -public final class SubscriptionsGetSamples { +public final class SubscriptionOperationGetSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/getSubscription. - * json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/ + * getSubscriptionOperation.json */ /** - * Sample code: getSubscription. + * Sample code: getPendingSubscriptionOperations. * * @param manager Entry point to SubscriptionManager. */ - public static void getSubscription(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptions() - .getWithResponse("83aa47df-e3e9-49ff-877b-94304bf3d3ad", com.azure.core.util.Context.NONE); + public static void + getPendingSubscriptionOperations(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptionOperations() + .getWithResponse("e4b8d068-f574-462a-a76f-6fa0afc613c9", com.azure.core.util.Context.NONE); } } ``` -### Subscriptions_List +### SubscriptionPolicy_AddUpdatePolicyForTenant ```java +import com.azure.resourcemanager.subscription.models.PutTenantPolicyRequestProperties; +import java.util.Arrays; +import java.util.UUID; + /** - * Samples for Subscriptions List. + * Samples for SubscriptionPolicy AddUpdatePolicyForTenant. */ -public final class SubscriptionsListSamples { +public final class SubscriptionPolicyAddUpdatePolicyForTenantSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/listSubscriptions. + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/changeTenantPolicy. * json */ /** - * Sample code: listSubscriptions. + * Sample code: TenantPolicy. * * @param manager Entry point to SubscriptionManager. */ - public static void listSubscriptions(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptions().list(com.azure.core.util.Context.NONE); + public static void tenantPolicy(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptionPolicies() + .addUpdatePolicyForTenantWithResponse( + new PutTenantPolicyRequestProperties().withBlockSubscriptionsLeavingTenant(true) + .withBlockSubscriptionsIntoTenant(true) + .withExemptedPrincipals(Arrays.asList(UUID.fromString("e879cf0f-2b4d-5431-109a-f72fc9868693"), + UUID.fromString("9792da87-c97b-410d-a97d-27021ba09ce6"))), + com.azure.core.util.Context.NONE); } } ``` -### Subscriptions_ListLocations +### SubscriptionPolicy_GetPolicyForTenant ```java /** - * Samples for Subscriptions ListLocations. + * Samples for SubscriptionPolicy GetPolicyForTenant. */ -public final class SubscriptionsListLocationsSamples { +public final class SubscriptionPolicyGetPolicyForTenantSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/listLocations.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicy. + * json */ /** - * Sample code: listLocations. + * Sample code: getTenantPolicy. * * @param manager Entry point to SubscriptionManager. */ - public static void listLocations(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptions().listLocations("83aa47df-e3e9-49ff-877b-94304bf3d3ad", com.azure.core.util.Context.NONE); + public static void getTenantPolicy(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptionPolicies().getPolicyForTenantWithResponse(com.azure.core.util.Context.NONE); } } ``` -### Tenants_List +### SubscriptionPolicy_ListPolicyForTenant ```java /** - * Samples for Tenants List. + * Samples for SubscriptionPolicy ListPolicyForTenant. */ -public final class TenantsListSamples { +public final class SubscriptionPolicyListPolicyForTenantSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/listTenants.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicyList + * .json */ /** - * Sample code: listTenants. + * Sample code: getTenantPolicyList. * * @param manager Entry point to SubscriptionManager. */ - public static void listTenants(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.tenants().list(com.azure.core.util.Context.NONE); + public static void getTenantPolicyList(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptionPolicies().listPolicyForTenant(com.azure.core.util.Context.NONE); } } ``` diff --git a/sdk/subscription/azure-resourcemanager-subscription/pom.xml b/sdk/subscription/azure-resourcemanager-subscription/pom.xml index 7b29e6dabdd4..84293d44c58f 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/pom.xml +++ b/sdk/subscription/azure-resourcemanager-subscription/pom.xml @@ -14,11 +14,11 @@ com.azure.resourcemanager azure-resourcemanager-subscription - 1.1.0-beta.1 + 1.1.0-beta.2 jar Microsoft Azure SDK for Subscription Management - This package contains Microsoft Azure SDK for Subscription Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The subscription client. Package tag package-2020-09. + This package contains Microsoft Azure SDK for Subscription Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The subscription client. Package tag package-2021-10. https://github.com/Azure/azure-sdk-for-java @@ -45,7 +45,7 @@ UTF-8 0 0 - false + true diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/SubscriptionManager.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/SubscriptionManager.java index 13fc94c42623..b2d2c3cb127f 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/SubscriptionManager.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/SubscriptionManager.java @@ -22,23 +22,27 @@ import com.azure.core.http.policy.UserAgentPolicy; import com.azure.core.management.profile.AzureProfile; import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.subscription.fluent.SubscriptionClient; import com.azure.resourcemanager.subscription.implementation.AliasImpl; +import com.azure.resourcemanager.subscription.implementation.BillingAccountsImpl; import com.azure.resourcemanager.subscription.implementation.OperationsImpl; import com.azure.resourcemanager.subscription.implementation.SubscriptionClientBuilder; import com.azure.resourcemanager.subscription.implementation.SubscriptionOperationsImpl; +import com.azure.resourcemanager.subscription.implementation.SubscriptionPoliciesImpl; import com.azure.resourcemanager.subscription.implementation.SubscriptionsImpl; -import com.azure.resourcemanager.subscription.implementation.TenantsImpl; import com.azure.resourcemanager.subscription.models.Alias; +import com.azure.resourcemanager.subscription.models.BillingAccounts; import com.azure.resourcemanager.subscription.models.Operations; import com.azure.resourcemanager.subscription.models.SubscriptionOperations; +import com.azure.resourcemanager.subscription.models.SubscriptionPolicies; import com.azure.resourcemanager.subscription.models.Subscriptions; -import com.azure.resourcemanager.subscription.models.Tenants; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -49,14 +53,16 @@ public final class SubscriptionManager { private Subscriptions subscriptions; - private Tenants tenants; - private SubscriptionOperations subscriptionOperations; private Operations operations; private Alias alias; + private SubscriptionPolicies subscriptionPolicies; + + private BillingAccounts billingAccounts; + private final SubscriptionClient clientObject; private SubscriptionManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -108,6 +114,9 @@ public static Configurable configure() { */ public static final class Configurable { private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); + private static final String SDK_VERSION = "version"; + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-resourcemanager-subscription.properties"); private HttpClient httpClient; private HttpLogOptions httpLogOptions; @@ -215,12 +224,14 @@ public SubscriptionManager authenticate(TokenCredential credential, AzureProfile Objects.requireNonNull(credential, "'credential' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + StringBuilder userAgentBuilder = new StringBuilder(); userAgentBuilder.append("azsdk-java") .append("-") .append("com.azure.resourcemanager.subscription") .append("/") - .append("1.0.0"); + .append(clientVersion); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -278,18 +289,6 @@ public Subscriptions subscriptions() { return subscriptions; } - /** - * Gets the resource collection API of Tenants. - * - * @return Resource collection API of Tenants. - */ - public Tenants tenants() { - if (this.tenants == null) { - this.tenants = new TenantsImpl(clientObject.getTenants(), this); - } - return tenants; - } - /** * Gets the resource collection API of SubscriptionOperations. * @@ -327,6 +326,30 @@ public Alias alias() { return alias; } + /** + * Gets the resource collection API of SubscriptionPolicies. + * + * @return Resource collection API of SubscriptionPolicies. + */ + public SubscriptionPolicies subscriptionPolicies() { + if (this.subscriptionPolicies == null) { + this.subscriptionPolicies = new SubscriptionPoliciesImpl(clientObject.getSubscriptionPolicies(), this); + } + return subscriptionPolicies; + } + + /** + * Gets the resource collection API of BillingAccounts. + * + * @return Resource collection API of BillingAccounts. + */ + public BillingAccounts billingAccounts() { + if (this.billingAccounts == null) { + this.billingAccounts = new BillingAccountsImpl(clientObject.getBillingAccounts(), this); + } + return billingAccounts; + } + /** * Gets wrapped service client SubscriptionClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/AliasClient.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/AliasClient.java index f3020133bb53..fa2efdd10c4a 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/AliasClient.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/AliasClient.java @@ -10,8 +10,8 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasListResultInner; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasResponseInner; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasListResultInner; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasResponseInner; import com.azure.resourcemanager.subscription.models.PutAliasRequest; /** @@ -21,8 +21,8 @@ public interface AliasClient { /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -30,14 +30,14 @@ public interface AliasClient { * @return the {@link SyncPoller} for polling of subscription Information with the alias. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PutAliasResponseInner> beginCreate(String aliasName, + SyncPoller, SubscriptionAliasResponseInner> beginCreate(String aliasName, PutAliasRequest body); /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -46,14 +46,14 @@ SyncPoller, PutAliasResponseInner> beginCreate * @return the {@link SyncPoller} for polling of subscription Information with the alias. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, PutAliasResponseInner> beginCreate(String aliasName, + SyncPoller, SubscriptionAliasResponseInner> beginCreate(String aliasName, PutAliasRequest body, Context context); /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -61,13 +61,13 @@ SyncPoller, PutAliasResponseInner> beginCreate * @return subscription Information with the alias. */ @ServiceMethod(returns = ReturnType.SINGLE) - PutAliasResponseInner create(String aliasName, PutAliasRequest body); + SubscriptionAliasResponseInner create(String aliasName, PutAliasRequest body); /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -76,13 +76,13 @@ SyncPoller, PutAliasResponseInner> beginCreate * @return subscription Information with the alias. */ @ServiceMethod(returns = ReturnType.SINGLE) - PutAliasResponseInner create(String aliasName, PutAliasRequest body, Context context); + SubscriptionAliasResponseInner create(String aliasName, PutAliasRequest body, Context context); /** * Get Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -90,26 +90,26 @@ SyncPoller, PutAliasResponseInner> beginCreate * @return alias Subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String aliasName, Context context); + Response getWithResponse(String aliasName, Context context); /** * Get Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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 alias Subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - PutAliasResponseInner get(String aliasName); + SubscriptionAliasResponseInner get(String aliasName); /** * Delete Alias. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -122,8 +122,8 @@ SyncPoller, PutAliasResponseInner> beginCreate /** * Delete Alias. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -132,24 +132,24 @@ SyncPoller, PutAliasResponseInner> beginCreate void delete(String aliasName); /** - * Get Alias Subscription. + * List Alias 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 alias Subscription along with {@link Response}. + * @return the list of aliases along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + Response listWithResponse(Context context); /** - * Get Alias Subscription. + * List Alias 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 alias Subscription. + * @return the list of aliases. */ @ServiceMethod(returns = ReturnType.SINGLE) - PutAliasListResultInner list(); + SubscriptionAliasListResultInner list(); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/TenantsClient.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/BillingAccountsClient.java similarity index 54% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/TenantsClient.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/BillingAccountsClient.java index fe3c73cd0cfc..36cd72914c31 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/TenantsClient.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/BillingAccountsClient.java @@ -6,33 +6,36 @@ 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.subscription.fluent.models.TenantIdDescriptionInner; +import com.azure.resourcemanager.subscription.fluent.models.BillingAccountPoliciesResponseInner; /** - * An instance of this class provides access to all the operations defined in TenantsClient. + * An instance of this class provides access to all the operations defined in BillingAccountsClient. */ -public interface TenantsClient { +public interface BillingAccountsClient { /** - * Gets the tenants for your account. + * Get Billing Account Policy. * + * @param billingAccountId Billing Account 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 tenants for your account as paginated response with {@link PagedIterable}. + * @return billing Account Policy along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPolicyWithResponse(String billingAccountId, Context context); /** - * Gets the tenants for your account. + * Get Billing Account Policy. * - * @param context The context to associate with this operation. + * @param billingAccountId Billing Account 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 tenants for your account as paginated response with {@link PagedIterable}. + * @return billing Account Policy. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + BillingAccountPoliciesResponseInner getPolicy(String billingAccountId); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/OperationsClient.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/OperationsClient.java index 4eb3edc9cf0d..d18d26715ebd 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/OperationsClient.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/OperationsClient.java @@ -6,9 +6,9 @@ import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; -import com.azure.resourcemanager.subscription.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.subscription.fluent.models.OperationInner; /** * An instance of this class provides access to all the operations defined in OperationsClient. @@ -17,22 +17,22 @@ public interface OperationsClient { /** * Lists all of the available Microsoft.Subscription API operations. * - * @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 result of the request to list operations along with {@link Response}. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response listWithResponse(Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); /** * Lists all of the available Microsoft.Subscription API operations. * + * @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 result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - OperationListResultInner list(); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionClient.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionClient.java index 746fe0655fb0..ebcb68105949 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionClient.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionClient.java @@ -18,6 +18,13 @@ public interface SubscriptionClient { */ String getEndpoint(); + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + String getApiVersion(); + /** * Gets The HTTP pipeline to send requests through. * @@ -39,13 +46,6 @@ public interface SubscriptionClient { */ SubscriptionsClient getSubscriptions(); - /** - * Gets the TenantsClient object to access its operations. - * - * @return the TenantsClient object. - */ - TenantsClient getTenants(); - /** * Gets the SubscriptionOperationsClient object to access its operations. * @@ -66,4 +66,18 @@ public interface SubscriptionClient { * @return the AliasClient object. */ AliasClient getAlias(); + + /** + * Gets the SubscriptionPoliciesClient object to access its operations. + * + * @return the SubscriptionPoliciesClient object. + */ + SubscriptionPoliciesClient getSubscriptionPolicies(); + + /** + * Gets the BillingAccountsClient object to access its operations. + * + * @return the BillingAccountsClient object. + */ + BillingAccountsClient getBillingAccounts(); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionOperationsClient.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionOperationsClient.java index ed34132e6193..55b5f17b50b0 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionOperationsClient.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionOperationsClient.java @@ -6,92 +6,38 @@ 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.subscription.fluent.models.CanceledSubscriptionIdInner; -import com.azure.resourcemanager.subscription.fluent.models.EnabledSubscriptionIdInner; -import com.azure.resourcemanager.subscription.fluent.models.RenamedSubscriptionIdInner; -import com.azure.resourcemanager.subscription.models.SubscriptionName; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionCreationResultInner; +import com.azure.resourcemanager.subscription.models.SubscriptionOperationsGetResponse; /** * An instance of this class provides access to all the operations defined in SubscriptionOperationsClient. */ public interface SubscriptionOperationsClient { /** - * The operation to cancel a subscription. + * Get the status of the pending Microsoft.Subscription API operations. * - * @param subscriptionId Subscription Id. + * @param operationId The operation ID, which can be found from the Location field in the generate recommendation + * response header. * @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 ID of the canceled subscription along with {@link Response}. + * @return the status of the pending Microsoft.Subscription API operations. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelWithResponse(String subscriptionId, Context context); + SubscriptionOperationsGetResponse getWithResponse(String operationId, Context context); /** - * The operation to cancel a subscription. + * Get the status of the pending Microsoft.Subscription API operations. * - * @param subscriptionId Subscription Id. + * @param operationId The operation ID, which can be found from the Location field in the generate recommendation + * response header. * @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 ID of the canceled subscription. + * @return the status of the pending Microsoft.Subscription API operations. */ @ServiceMethod(returns = ReturnType.SINGLE) - CanceledSubscriptionIdInner cancel(String subscriptionId); - - /** - * The operation to rename a subscription. - * - * @param subscriptionId Subscription Id. - * @param body Subscription 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 ID of the subscriptions that is being renamed along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response renameWithResponse(String subscriptionId, SubscriptionName body, - Context context); - - /** - * The operation to rename a subscription. - * - * @param subscriptionId Subscription Id. - * @param body Subscription 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 ID of the subscriptions that is being renamed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RenamedSubscriptionIdInner rename(String subscriptionId, SubscriptionName body); - - /** - * The operation to enable a subscription. - * - * @param subscriptionId Subscription 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 ID of the subscriptions that is being enabled along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response enableWithResponse(String subscriptionId, Context context); - - /** - * The operation to enable a subscription. - * - * @param subscriptionId Subscription 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 ID of the subscriptions that is being enabled. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - EnabledSubscriptionIdInner enable(String subscriptionId); + SubscriptionCreationResultInner get(String operationId); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionPoliciesClient.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionPoliciesClient.java new file mode 100644 index 000000000000..d5ffc591a01b --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionPoliciesClient.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.fluent.models.GetTenantPolicyResponseInner; +import com.azure.resourcemanager.subscription.models.PutTenantPolicyRequestProperties; + +/** + * An instance of this class provides access to all the operations defined in SubscriptionPoliciesClient. + */ +public interface SubscriptionPoliciesClient { + /** + * Create or Update Subscription tenant policy for user's tenant. + * + * @param body The body parameter. + * @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 tenant policy Information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response addUpdatePolicyForTenantWithResponse(PutTenantPolicyRequestProperties body, + Context context); + + /** + * Create or Update Subscription tenant policy for user's tenant. + * + * @param body The body parameter. + * @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 tenant policy Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetTenantPolicyResponseInner addUpdatePolicyForTenant(PutTenantPolicyRequestProperties body); + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getPolicyForTenantWithResponse(Context context); + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GetTenantPolicyResponseInner getPolicyForTenant(); + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPolicyForTenant(); + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listPolicyForTenant(Context context); +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionsClient.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionsClient.java index 1767d103d02f..bb383985a909 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionsClient.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/SubscriptionsClient.java @@ -6,91 +6,175 @@ 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.resourcemanager.subscription.fluent.models.LocationInner; -import com.azure.resourcemanager.subscription.fluent.models.SubscriptionInner; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.subscription.fluent.models.AcceptOwnershipStatusResponseInner; +import com.azure.resourcemanager.subscription.fluent.models.CanceledSubscriptionIdInner; +import com.azure.resourcemanager.subscription.fluent.models.EnabledSubscriptionIdInner; +import com.azure.resourcemanager.subscription.fluent.models.RenamedSubscriptionIdInner; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequest; +import com.azure.resourcemanager.subscription.models.SubscriptionName; /** * An instance of this class provides access to all the operations defined in SubscriptionsClient. */ public interface SubscriptionsClient { /** - * Gets all available geo-locations. + * The operation to cancel a subscription. * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription 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 location list operation response as paginated response with {@link PagedIterable}. + * @return the ID of the canceled subscription along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listLocations(String subscriptionId); + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse(String subscriptionId, Context context); /** - * Gets all available geo-locations. + * The operation to cancel a subscription. * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. + * @param subscriptionId Subscription 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 ID of the canceled subscription. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CanceledSubscriptionIdInner cancel(String subscriptionId); + + /** + * The operation to rename a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. + * @param body Subscription 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 location list operation response as paginated response with {@link PagedIterable}. + * @return the ID of the subscriptions that is being renamed along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listLocations(String subscriptionId, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response renameWithResponse(String subscriptionId, SubscriptionName body, + Context context); /** - * Gets details about a specified subscription. + * The operation to rename a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. + * @param body Subscription 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 ID of the subscriptions that is being renamed. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RenamedSubscriptionIdInner rename(String subscriptionId, SubscriptionName body); + + /** + * The operation to enable a subscription. + * + * @param subscriptionId Subscription 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 details about a specified subscription along with {@link Response}. + * @return the ID of the subscriptions that is being enabled along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response enableWithResponse(String subscriptionId, Context context); + + /** + * The operation to enable a subscription. + * + * @param subscriptionId Subscription 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 ID of the subscriptions that is being enabled. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String subscriptionId, Context context); + EnabledSubscriptionIdInner enable(String subscriptionId); /** - * Gets details about a specified subscription. + * Accept subscription ownership. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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> beginAcceptOwnership(String subscriptionId, AcceptOwnershipRequest body); + + /** + * Accept subscription ownership. + * + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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> beginAcceptOwnership(String subscriptionId, AcceptOwnershipRequest body, + Context context); + + /** + * Accept subscription ownership. + * + * @param subscriptionId Subscription Id. + * @param body The body parameter. * @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 details about a specified subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - SubscriptionInner get(String subscriptionId); + void acceptOwnership(String subscriptionId, AcceptOwnershipRequest body); /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership. * + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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 all subscriptions for a tenant as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + @ServiceMethod(returns = ReturnType.SINGLE) + void acceptOwnership(String subscriptionId, AcceptOwnershipRequest body, Context context); /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership status. * + * @param subscriptionId Subscription 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 all subscriptions for a tenant as paginated response with {@link PagedIterable}. + * @return subscription Accept Ownership Response along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response acceptOwnershipStatusWithResponse(String subscriptionId, + Context context); + + /** + * Accept subscription ownership status. + * + * @param subscriptionId Subscription 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 subscription Accept Ownership Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + AcceptOwnershipStatusResponseInner acceptOwnershipStatus(String subscriptionId); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/AcceptOwnershipStatusResponseInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/AcceptOwnershipStatusResponseInner.java new file mode 100644 index 000000000000..7f80877e3513 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/AcceptOwnershipStatusResponseInner.java @@ -0,0 +1,220 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.fluent.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 com.azure.resourcemanager.subscription.models.AcceptOwnership; +import com.azure.resourcemanager.subscription.models.Provisioning; +import java.io.IOException; +import java.util.Map; + +/** + * Subscription Accept Ownership Response. + */ +@Fluent +public final class AcceptOwnershipStatusResponseInner implements JsonSerializable { + /* + * Newly created subscription Id. + */ + private String subscriptionId; + + /* + * The accept ownership state of the resource. + */ + private AcceptOwnership acceptOwnershipState; + + /* + * The provisioning state of the resource. + */ + private Provisioning provisioningState; + + /* + * UPN of the billing owner + */ + private String billingOwner; + + /* + * Tenant Id of the subscription + */ + private String subscriptionTenantId; + + /* + * The display name of the subscription. + */ + private String displayName; + + /* + * Tags for the subscription + */ + private Map tags; + + /** + * Creates an instance of AcceptOwnershipStatusResponseInner class. + */ + public AcceptOwnershipStatusResponseInner() { + } + + /** + * Get the subscriptionId property: Newly created subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the acceptOwnershipState property: The accept ownership state of the resource. + * + * @return the acceptOwnershipState value. + */ + public AcceptOwnership acceptOwnershipState() { + return this.acceptOwnershipState; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public Provisioning provisioningState() { + return this.provisioningState; + } + + /** + * Get the billingOwner property: UPN of the billing owner. + * + * @return the billingOwner value. + */ + public String billingOwner() { + return this.billingOwner; + } + + /** + * Get the subscriptionTenantId property: Tenant Id of the subscription. + * + * @return the subscriptionTenantId value. + */ + public String subscriptionTenantId() { + return this.subscriptionTenantId; + } + + /** + * Set the subscriptionTenantId property: Tenant Id of the subscription. + * + * @param subscriptionTenantId the subscriptionTenantId value to set. + * @return the AcceptOwnershipStatusResponseInner object itself. + */ + public AcceptOwnershipStatusResponseInner withSubscriptionTenantId(String subscriptionTenantId) { + this.subscriptionTenantId = subscriptionTenantId; + return this; + } + + /** + * Get the displayName property: The display name of the subscription. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the subscription. + * + * @param displayName the displayName value to set. + * @return the AcceptOwnershipStatusResponseInner object itself. + */ + public AcceptOwnershipStatusResponseInner withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the tags property: Tags for the subscription. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags for the subscription. + * + * @param tags the tags value to set. + * @return the AcceptOwnershipStatusResponseInner object itself. + */ + public AcceptOwnershipStatusResponseInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("subscriptionTenantId", this.subscriptionTenantId); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcceptOwnershipStatusResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcceptOwnershipStatusResponseInner 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 AcceptOwnershipStatusResponseInner. + */ + public static AcceptOwnershipStatusResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcceptOwnershipStatusResponseInner deserializedAcceptOwnershipStatusResponseInner + = new AcceptOwnershipStatusResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptionId".equals(fieldName)) { + deserializedAcceptOwnershipStatusResponseInner.subscriptionId = reader.getString(); + } else if ("acceptOwnershipState".equals(fieldName)) { + deserializedAcceptOwnershipStatusResponseInner.acceptOwnershipState + = AcceptOwnership.fromString(reader.getString()); + } else if ("provisioningState".equals(fieldName)) { + deserializedAcceptOwnershipStatusResponseInner.provisioningState + = Provisioning.fromString(reader.getString()); + } else if ("billingOwner".equals(fieldName)) { + deserializedAcceptOwnershipStatusResponseInner.billingOwner = reader.getString(); + } else if ("subscriptionTenantId".equals(fieldName)) { + deserializedAcceptOwnershipStatusResponseInner.subscriptionTenantId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedAcceptOwnershipStatusResponseInner.displayName = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAcceptOwnershipStatusResponseInner.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAcceptOwnershipStatusResponseInner; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/BillingAccountPoliciesResponseInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/BillingAccountPoliciesResponseInner.java new file mode 100644 index 000000000000..a6b49d63e428 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/BillingAccountPoliciesResponseInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.models.BillingAccountPoliciesResponseProperties; +import java.io.IOException; + +/** + * Billing account policies information. + */ +@Fluent +public final class BillingAccountPoliciesResponseInner extends ProxyResource { + /* + * Billing account policies response properties. + */ + private BillingAccountPoliciesResponseProperties properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + 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 BillingAccountPoliciesResponseInner class. + */ + public BillingAccountPoliciesResponseInner() { + } + + /** + * Get the properties property: Billing account policies response properties. + * + * @return the properties value. + */ + public BillingAccountPoliciesResponseProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Billing account policies response properties. + * + * @param properties the properties value to set. + * @return the BillingAccountPoliciesResponseInner object itself. + */ + public BillingAccountPoliciesResponseInner withProperties(BillingAccountPoliciesResponseProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BillingAccountPoliciesResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BillingAccountPoliciesResponseInner 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 BillingAccountPoliciesResponseInner. + */ + public static BillingAccountPoliciesResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BillingAccountPoliciesResponseInner deserializedBillingAccountPoliciesResponseInner + = new BillingAccountPoliciesResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedBillingAccountPoliciesResponseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedBillingAccountPoliciesResponseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedBillingAccountPoliciesResponseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedBillingAccountPoliciesResponseInner.properties + = BillingAccountPoliciesResponseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedBillingAccountPoliciesResponseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBillingAccountPoliciesResponseInner; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/PutAliasResponseInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/GetTenantPolicyResponseInner.java similarity index 57% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/PutAliasResponseInner.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/GetTenantPolicyResponseInner.java index a63a78bed1cb..e9d3e0d05646 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/PutAliasResponseInner.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/GetTenantPolicyResponseInner.java @@ -6,21 +6,27 @@ 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.subscription.models.PutAliasResponseProperties; +import com.azure.resourcemanager.subscription.models.TenantPolicy; import java.io.IOException; /** - * Subscription Information with the alias. + * Tenant policy Information. */ @Fluent -public final class PutAliasResponseInner extends ProxyResource { +public final class GetTenantPolicyResponseInner extends ProxyResource { /* - * Put Alias response properties. + * Tenant policy properties. */ - private PutAliasResponseProperties properties; + private TenantPolicy properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + private SystemData systemData; /* * The type of the resource. @@ -38,31 +44,40 @@ public final class PutAliasResponseInner extends ProxyResource { private String id; /** - * Creates an instance of PutAliasResponseInner class. + * Creates an instance of GetTenantPolicyResponseInner class. */ - public PutAliasResponseInner() { + public GetTenantPolicyResponseInner() { } /** - * Get the properties property: Put Alias response properties. + * Get the properties property: Tenant policy properties. * * @return the properties value. */ - public PutAliasResponseProperties properties() { + public TenantPolicy properties() { return this.properties; } /** - * Set the properties property: Put Alias response properties. + * Set the properties property: Tenant policy properties. * * @param properties the properties value to set. - * @return the PutAliasResponseInner object itself. + * @return the GetTenantPolicyResponseInner object itself. */ - public PutAliasResponseInner withProperties(PutAliasResponseProperties properties) { + public GetTenantPolicyResponseInner withProperties(TenantPolicy properties) { this.properties = properties; return this; } + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -115,35 +130,37 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of PutAliasResponseInner from the JsonReader. + * Reads an instance of GetTenantPolicyResponseInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of PutAliasResponseInner if the JsonReader was pointing to an instance of it, or null if it - * was pointing to JSON null. + * @return An instance of GetTenantPolicyResponseInner 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 PutAliasResponseInner. + * @throws IOException If an error occurs while reading the GetTenantPolicyResponseInner. */ - public static PutAliasResponseInner fromJson(JsonReader jsonReader) throws IOException { + public static GetTenantPolicyResponseInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - PutAliasResponseInner deserializedPutAliasResponseInner = new PutAliasResponseInner(); + GetTenantPolicyResponseInner deserializedGetTenantPolicyResponseInner = new GetTenantPolicyResponseInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedPutAliasResponseInner.id = reader.getString(); + deserializedGetTenantPolicyResponseInner.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedPutAliasResponseInner.name = reader.getString(); + deserializedGetTenantPolicyResponseInner.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedPutAliasResponseInner.type = reader.getString(); + deserializedGetTenantPolicyResponseInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { - deserializedPutAliasResponseInner.properties = PutAliasResponseProperties.fromJson(reader); + deserializedGetTenantPolicyResponseInner.properties = TenantPolicy.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGetTenantPolicyResponseInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedPutAliasResponseInner; + return deserializedGetTenantPolicyResponseInner; }); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/LocationInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/LocationInner.java deleted file mode 100644 index f5760a3873e7..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/LocationInner.java +++ /dev/null @@ -1,163 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.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 java.io.IOException; - -/** - * Location information. - */ -@Immutable -public final class LocationInner implements JsonSerializable { - /* - * The fully qualified ID of the location. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. - */ - private String id; - - /* - * The subscription ID. - */ - private String subscriptionId; - - /* - * The location name. - */ - private String name; - - /* - * The display name of the location. - */ - private String displayName; - - /* - * The latitude of the location. - */ - private String latitude; - - /* - * The longitude of the location. - */ - private String longitude; - - /** - * Creates an instance of LocationInner class. - */ - public LocationInner() { - } - - /** - * Get the id property: The fully qualified ID of the location. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the subscriptionId property: The subscription ID. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the name property: The location name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the displayName property: The display name of the location. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the latitude property: The latitude of the location. - * - * @return the latitude value. - */ - public String latitude() { - return this.latitude; - } - - /** - * Get the longitude property: The longitude of the location. - * - * @return the longitude value. - */ - public String longitude() { - return this.longitude; - } - - /** - * 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 LocationInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LocationInner 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 LocationInner. - */ - public static LocationInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LocationInner deserializedLocationInner = new LocationInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedLocationInner.id = reader.getString(); - } else if ("subscriptionId".equals(fieldName)) { - deserializedLocationInner.subscriptionId = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedLocationInner.name = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedLocationInner.displayName = reader.getString(); - } else if ("latitude".equals(fieldName)) { - deserializedLocationInner.latitude = reader.getString(); - } else if ("longitude".equals(fieldName)) { - deserializedLocationInner.longitude = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedLocationInner; - }); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/OperationInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/OperationInner.java new file mode 100644 index 000000000000..3ba00de90f0e --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/OperationInner.java @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.fluent.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 com.azure.resourcemanager.subscription.models.OperationDisplay; +import java.io.IOException; + +/** + * REST API operation. + */ +@Fluent +public final class OperationInner implements JsonSerializable { + /* + * Operation name: {provider}/{resource}/{operation} + */ + private String name; + + /* + * Indicates whether the operation is a data action + */ + private Boolean isDataAction; + + /* + * The object that represents the operation. + */ + private OperationDisplay display; + + /** + * Creates an instance of OperationInner class. + */ + public OperationInner() { + } + + /** + * Get the name property: Operation name: {provider}/{resource}/{operation}. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Operation name: {provider}/{resource}/{operation}. + * + * @param name the name value to set. + * @return the OperationInner object itself. + */ + public OperationInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the isDataAction property: Indicates whether the operation is a data action. + * + * @return the isDataAction value. + */ + public Boolean isDataAction() { + return this.isDataAction; + } + + /** + * Set the isDataAction property: Indicates whether the operation is a data action. + * + * @param isDataAction the isDataAction value to set. + * @return the OperationInner object itself. + */ + public OperationInner withIsDataAction(Boolean isDataAction) { + this.isDataAction = isDataAction; + return this; + } + + /** + * Get the display property: The object that represents the operation. + * + * @return the display value. + */ + public OperationDisplay display() { + return this.display; + } + + /** + * Set the display property: The object that represents the operation. + * + * @param display the display value to set. + * @return the OperationInner object itself. + */ + public OperationInner withDisplay(OperationDisplay display) { + this.display = display; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (display() != null) { + display().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeBooleanField("isDataAction", this.isDataAction); + jsonWriter.writeJsonField("display", this.display); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationInner 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 OperationInner. + */ + public static OperationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationInner deserializedOperationInner = new OperationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedOperationInner.name = reader.getString(); + } else if ("isDataAction".equals(fieldName)) { + deserializedOperationInner.isDataAction = reader.getNullable(JsonReader::getBoolean); + } else if ("display".equals(fieldName)) { + deserializedOperationInner.display = OperationDisplay.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationInner; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/OperationListResultInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/OperationListResultInner.java deleted file mode 100644 index 40cf17134c89..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/OperationListResultInner.java +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.fluent.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 com.azure.resourcemanager.subscription.models.Operation; -import java.io.IOException; -import java.util.List; - -/** - * Result of the request to list operations. It contains a list of operations and a URL link to get the next set of - * results. - */ -@Fluent -public final class OperationListResultInner implements JsonSerializable { - /* - * List of operations. - */ - private List value; - - /* - * URL to get the next set of operation list results if there are any. - */ - private String nextLink; - - /** - * Creates an instance of OperationListResultInner class. - */ - public OperationListResultInner() { - } - - /** - * Get the value property: List of operations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: List of operations. - * - * @param value the value value to set. - * @return the OperationListResultInner object itself. - */ - public OperationListResultInner withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results if there are any. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the OperationListResultInner object itself. - */ - public OperationListResultInner withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@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 OperationListResultInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationListResultInner 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 OperationListResultInner. - */ - public static OperationListResultInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationListResultInner deserializedOperationListResultInner = new OperationListResultInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> Operation.fromJson(reader1)); - deserializedOperationListResultInner.value = value; - } else if ("nextLink".equals(fieldName)) { - deserializedOperationListResultInner.nextLink = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationListResultInner; - }); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/PutAliasListResultInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionAliasListResultInner.java similarity index 61% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/PutAliasListResultInner.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionAliasListResultInner.java index 7b30a6ab3152..74e68bf602b8 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/PutAliasListResultInner.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionAliasListResultInner.java @@ -16,11 +16,11 @@ * The list of aliases. */ @Immutable -public final class PutAliasListResultInner implements JsonSerializable { +public final class SubscriptionAliasListResultInner implements JsonSerializable { /* * The list of alias. */ - private List value; + private List value; /* * The link (url) to the next page of results. @@ -28,9 +28,9 @@ public final class PutAliasListResultInner implements JsonSerializable value() { + public List value() { return this.value; } @@ -72,32 +72,33 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of PutAliasListResultInner from the JsonReader. + * Reads an instance of SubscriptionAliasListResultInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of PutAliasListResultInner 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 PutAliasListResultInner. + * @return An instance of SubscriptionAliasListResultInner 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 SubscriptionAliasListResultInner. */ - public static PutAliasListResultInner fromJson(JsonReader jsonReader) throws IOException { + public static SubscriptionAliasListResultInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - PutAliasListResultInner deserializedPutAliasListResultInner = new PutAliasListResultInner(); + SubscriptionAliasListResultInner deserializedSubscriptionAliasListResultInner + = new SubscriptionAliasListResultInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> PutAliasResponseInner.fromJson(reader1)); - deserializedPutAliasListResultInner.value = value; + List value + = reader.readArray(reader1 -> SubscriptionAliasResponseInner.fromJson(reader1)); + deserializedSubscriptionAliasListResultInner.value = value; } else if ("nextLink".equals(fieldName)) { - deserializedPutAliasListResultInner.nextLink = reader.getString(); + deserializedSubscriptionAliasListResultInner.nextLink = reader.getString(); } else { reader.skipChildren(); } } - return deserializedPutAliasListResultInner; + return deserializedSubscriptionAliasListResultInner; }); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionAliasResponseInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionAliasResponseInner.java new file mode 100644 index 000000000000..f8d6b9f28517 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionAliasResponseInner.java @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.models.SubscriptionAliasResponseProperties; +import java.io.IOException; + +/** + * Subscription Information with the alias. + */ +@Fluent +public final class SubscriptionAliasResponseInner extends ProxyResource { + /* + * Subscription Alias response properties. + */ + private SubscriptionAliasResponseProperties properties; + + /* + * Metadata pertaining to creation and last modification of the resource. + */ + 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 SubscriptionAliasResponseInner class. + */ + public SubscriptionAliasResponseInner() { + } + + /** + * Get the properties property: Subscription Alias response properties. + * + * @return the properties value. + */ + public SubscriptionAliasResponseProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Subscription Alias response properties. + * + * @param properties the properties value to set. + * @return the SubscriptionAliasResponseInner object itself. + */ + public SubscriptionAliasResponseInner withProperties(SubscriptionAliasResponseProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @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; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionAliasResponseInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionAliasResponseInner 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 SubscriptionAliasResponseInner. + */ + public static SubscriptionAliasResponseInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionAliasResponseInner deserializedSubscriptionAliasResponseInner + = new SubscriptionAliasResponseInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedSubscriptionAliasResponseInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedSubscriptionAliasResponseInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedSubscriptionAliasResponseInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedSubscriptionAliasResponseInner.properties + = SubscriptionAliasResponseProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSubscriptionAliasResponseInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionAliasResponseInner; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionCreationResultInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionCreationResultInner.java new file mode 100644 index 000000000000..3b30a00d9c16 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionCreationResultInner.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.fluent.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; + +/** + * The created subscription object. + */ +@Fluent +public final class SubscriptionCreationResultInner implements JsonSerializable { + /* + * The link to the new subscription. Use this link to check the status of subscription creation operation. + */ + private String subscriptionLink; + + /** + * Creates an instance of SubscriptionCreationResultInner class. + */ + public SubscriptionCreationResultInner() { + } + + /** + * Get the subscriptionLink property: The link to the new subscription. Use this link to check the status of + * subscription creation operation. + * + * @return the subscriptionLink value. + */ + public String subscriptionLink() { + return this.subscriptionLink; + } + + /** + * Set the subscriptionLink property: The link to the new subscription. Use this link to check the status of + * subscription creation operation. + * + * @param subscriptionLink the subscriptionLink value to set. + * @return the SubscriptionCreationResultInner object itself. + */ + public SubscriptionCreationResultInner withSubscriptionLink(String subscriptionLink) { + this.subscriptionLink = subscriptionLink; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("subscriptionLink", this.subscriptionLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionCreationResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionCreationResultInner 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 SubscriptionCreationResultInner. + */ + public static SubscriptionCreationResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionCreationResultInner deserializedSubscriptionCreationResultInner + = new SubscriptionCreationResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptionLink".equals(fieldName)) { + deserializedSubscriptionCreationResultInner.subscriptionLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionCreationResultInner; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionInner.java deleted file mode 100644 index f27f11ea2ce1..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/SubscriptionInner.java +++ /dev/null @@ -1,241 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.fluent.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 com.azure.resourcemanager.subscription.models.SubscriptionPolicies; -import com.azure.resourcemanager.subscription.models.SubscriptionState; -import java.io.IOException; -import java.util.Map; - -/** - * Subscription information. - */ -@Fluent -public final class SubscriptionInner implements JsonSerializable { - /* - * The fully qualified ID for the subscription. For example, /subscriptions/00000000-0000-0000-0000-000000000000. - */ - private String id; - - /* - * The subscription ID. - */ - private String subscriptionId; - - /* - * The subscription display name. - */ - private String displayName; - - /* - * The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. - */ - private SubscriptionState state; - - /* - * The tenant ID. For example, 00000000-0000-0000-0000-000000000000. - */ - private String tenantId; - - /* - * Tags for the subscription - */ - private Map tags; - - /* - * The subscription policies. - */ - private SubscriptionPolicies subscriptionPolicies; - - /* - * The authorization source of the request. Valid values are one or more combinations of Legacy, RoleBased, - * Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. - */ - private String authorizationSource; - - /** - * Creates an instance of SubscriptionInner class. - */ - public SubscriptionInner() { - } - - /** - * Get the id property: The fully qualified ID for the subscription. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the subscriptionId property: The subscription ID. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the displayName property: The subscription display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the state property: The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and - * Deleted. - * - * @return the state value. - */ - public SubscriptionState state() { - return this.state; - } - - /** - * Get the tenantId property: The tenant ID. For example, 00000000-0000-0000-0000-000000000000. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the tags property: Tags for the subscription. - * - * @return the tags value. - */ - public Map tags() { - return this.tags; - } - - /** - * Set the tags property: Tags for the subscription. - * - * @param tags the tags value to set. - * @return the SubscriptionInner object itself. - */ - public SubscriptionInner withTags(Map tags) { - this.tags = tags; - return this; - } - - /** - * Get the subscriptionPolicies property: The subscription policies. - * - * @return the subscriptionPolicies value. - */ - public SubscriptionPolicies subscriptionPolicies() { - return this.subscriptionPolicies; - } - - /** - * Set the subscriptionPolicies property: The subscription policies. - * - * @param subscriptionPolicies the subscriptionPolicies value to set. - * @return the SubscriptionInner object itself. - */ - public SubscriptionInner withSubscriptionPolicies(SubscriptionPolicies subscriptionPolicies) { - this.subscriptionPolicies = subscriptionPolicies; - return this; - } - - /** - * Get the authorizationSource property: The authorization source of the request. Valid values are one or more - * combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. - * - * @return the authorizationSource value. - */ - public String authorizationSource() { - return this.authorizationSource; - } - - /** - * Set the authorizationSource property: The authorization source of the request. Valid values are one or more - * combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. - * - * @param authorizationSource the authorizationSource value to set. - * @return the SubscriptionInner object itself. - */ - public SubscriptionInner withAuthorizationSource(String authorizationSource) { - this.authorizationSource = authorizationSource; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (subscriptionPolicies() != null) { - subscriptionPolicies().validate(); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("subscriptionPolicies", this.subscriptionPolicies); - jsonWriter.writeStringField("authorizationSource", this.authorizationSource); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of SubscriptionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionInner 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 SubscriptionInner. - */ - public static SubscriptionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionInner deserializedSubscriptionInner = new SubscriptionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedSubscriptionInner.id = reader.getString(); - } else if ("subscriptionId".equals(fieldName)) { - deserializedSubscriptionInner.subscriptionId = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedSubscriptionInner.displayName = reader.getString(); - } else if ("state".equals(fieldName)) { - deserializedSubscriptionInner.state = SubscriptionState.fromString(reader.getString()); - } else if ("tenantId".equals(fieldName)) { - deserializedSubscriptionInner.tenantId = reader.getString(); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSubscriptionInner.tags = tags; - } else if ("subscriptionPolicies".equals(fieldName)) { - deserializedSubscriptionInner.subscriptionPolicies = SubscriptionPolicies.fromJson(reader); - } else if ("authorizationSource".equals(fieldName)) { - deserializedSubscriptionInner.authorizationSource = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionInner; - }); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/TenantIdDescriptionInner.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/TenantIdDescriptionInner.java deleted file mode 100644 index f093f2d501d5..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/fluent/models/TenantIdDescriptionInner.java +++ /dev/null @@ -1,212 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.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 java.io.IOException; - -/** - * Tenant Id information. - */ -@Immutable -public final class TenantIdDescriptionInner implements JsonSerializable { - /* - * The fully qualified ID of the tenant. For example, /tenants/00000000-0000-0000-0000-000000000000. - */ - private String id; - - /* - * The tenant ID. For example, 00000000-0000-0000-0000-000000000000. - */ - private String tenantId; - - /* - * The category of the tenant. Possible values are - * TenantCategoryHome,TenantCategoryProjectedBy,TenantCategoryManagedBy - */ - private String tenantCategory; - - /* - * The country/region name of the address for the tenant. - */ - private String country; - - /* - * The Country/region abbreviation for the tenant. - */ - private String countryCode; - - /* - * The display name of the tenant. - */ - private String displayName; - - /* - * The list of domains for the tenant. - */ - private String domains; - - /* - * The default domain for the tenant. - */ - private String defaultDomain; - - /* - * The tenant type. Only available for Home tenant category. - */ - private String tenantType; - - /** - * Creates an instance of TenantIdDescriptionInner class. - */ - public TenantIdDescriptionInner() { - } - - /** - * Get the id property: The fully qualified ID of the tenant. For example, - * /tenants/00000000-0000-0000-0000-000000000000. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the tenantId property: The tenant ID. For example, 00000000-0000-0000-0000-000000000000. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Get the tenantCategory property: The category of the tenant. Possible values are - * TenantCategoryHome,TenantCategoryProjectedBy,TenantCategoryManagedBy. - * - * @return the tenantCategory value. - */ - public String tenantCategory() { - return this.tenantCategory; - } - - /** - * Get the country property: The country/region name of the address for the tenant. - * - * @return the country value. - */ - public String country() { - return this.country; - } - - /** - * Get the countryCode property: The Country/region abbreviation for the tenant. - * - * @return the countryCode value. - */ - public String countryCode() { - return this.countryCode; - } - - /** - * Get the displayName property: The display name of the tenant. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the domains property: The list of domains for the tenant. - * - * @return the domains value. - */ - public String domains() { - return this.domains; - } - - /** - * Get the defaultDomain property: The default domain for the tenant. - * - * @return the defaultDomain value. - */ - public String defaultDomain() { - return this.defaultDomain; - } - - /** - * Get the tenantType property: The tenant type. Only available for Home tenant category. - * - * @return the tenantType value. - */ - public String tenantType() { - return this.tenantType; - } - - /** - * 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 TenantIdDescriptionInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TenantIdDescriptionInner 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 TenantIdDescriptionInner. - */ - public static TenantIdDescriptionInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TenantIdDescriptionInner deserializedTenantIdDescriptionInner = new TenantIdDescriptionInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedTenantIdDescriptionInner.id = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedTenantIdDescriptionInner.tenantId = reader.getString(); - } else if ("tenantCategory".equals(fieldName)) { - deserializedTenantIdDescriptionInner.tenantCategory = reader.getString(); - } else if ("country".equals(fieldName)) { - deserializedTenantIdDescriptionInner.country = reader.getString(); - } else if ("countryCode".equals(fieldName)) { - deserializedTenantIdDescriptionInner.countryCode = reader.getString(); - } else if ("displayName".equals(fieldName)) { - deserializedTenantIdDescriptionInner.displayName = reader.getString(); - } else if ("domains".equals(fieldName)) { - deserializedTenantIdDescriptionInner.domains = reader.getString(); - } else if ("defaultDomain".equals(fieldName)) { - deserializedTenantIdDescriptionInner.defaultDomain = reader.getString(); - } else if ("tenantType".equals(fieldName)) { - deserializedTenantIdDescriptionInner.tenantType = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedTenantIdDescriptionInner; - }); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AcceptOwnershipStatusResponseImpl.java similarity index 53% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionImpl.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AcceptOwnershipStatusResponseImpl.java index a13038a95430..d45c9c459360 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AcceptOwnershipStatusResponseImpl.java @@ -4,42 +4,46 @@ package com.azure.resourcemanager.subscription.implementation; -import com.azure.resourcemanager.subscription.fluent.models.SubscriptionInner; -import com.azure.resourcemanager.subscription.models.Subscription; -import com.azure.resourcemanager.subscription.models.SubscriptionPolicies; -import com.azure.resourcemanager.subscription.models.SubscriptionState; +import com.azure.resourcemanager.subscription.fluent.models.AcceptOwnershipStatusResponseInner; +import com.azure.resourcemanager.subscription.models.AcceptOwnership; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipStatusResponse; +import com.azure.resourcemanager.subscription.models.Provisioning; import java.util.Collections; import java.util.Map; -public final class SubscriptionImpl implements Subscription { - private SubscriptionInner innerObject; +public final class AcceptOwnershipStatusResponseImpl implements AcceptOwnershipStatusResponse { + private AcceptOwnershipStatusResponseInner innerObject; private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; - SubscriptionImpl(SubscriptionInner innerObject, + AcceptOwnershipStatusResponseImpl(AcceptOwnershipStatusResponseInner innerObject, com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public String id() { - return this.innerModel().id(); - } - public String subscriptionId() { return this.innerModel().subscriptionId(); } - public String displayName() { - return this.innerModel().displayName(); + public AcceptOwnership acceptOwnershipState() { + return this.innerModel().acceptOwnershipState(); + } + + public Provisioning provisioningState() { + return this.innerModel().provisioningState(); + } + + public String billingOwner() { + return this.innerModel().billingOwner(); } - public SubscriptionState state() { - return this.innerModel().state(); + public String subscriptionTenantId() { + return this.innerModel().subscriptionTenantId(); } - public String tenantId() { - return this.innerModel().tenantId(); + public String displayName() { + return this.innerModel().displayName(); } public Map tags() { @@ -51,15 +55,7 @@ public Map tags() { } } - public SubscriptionPolicies subscriptionPolicies() { - return this.innerModel().subscriptionPolicies(); - } - - public String authorizationSource() { - return this.innerModel().authorizationSource(); - } - - public SubscriptionInner innerModel() { + public AcceptOwnershipStatusResponseInner innerModel() { return this.innerObject; } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AliasClientImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AliasClientImpl.java index c3be5eebfd89..e03fc5c143f7 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AliasClientImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AliasClientImpl.java @@ -23,13 +23,15 @@ 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.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.subscription.fluent.AliasClient; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasListResultInner; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasResponseInner; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasListResultInner; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasResponseInner; import com.azure.resourcemanager.subscription.models.PutAliasRequest; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -64,7 +66,7 @@ public final class AliasClientImpl implements AliasClient { * REST calls. */ @Host("{$host}") - @ServiceInterface(name = "SubscriptionClientAl") + @ServiceInterface(name = "SubscriptionClientAlias") public interface AliasService { @Headers({ "Content-Type: application/json" }) @Put("/providers/Microsoft.Subscription/aliases/{aliasName}") @@ -74,11 +76,27 @@ Mono>> create(@HostParam("$host") String endpoint, @PathParam("aliasName") String aliasName, @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PutAliasRequest body, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Put("/providers/Microsoft.Subscription/aliases/{aliasName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("$host") String endpoint, @PathParam("aliasName") String aliasName, + @QueryParam("api-version") String apiVersion, @BodyParam("application/json") PutAliasRequest body, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Subscription/aliases/{aliasName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Mono> get(@HostParam("$host") String endpoint, + @PathParam("aliasName") String aliasName, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Subscription/aliases/{aliasName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getSync(@HostParam("$host") String endpoint, @PathParam("aliasName") String aliasName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @@ -89,19 +107,33 @@ Mono> get(@HostParam("$host") String endpoint, Mono> delete(@HostParam("$host") String endpoint, @PathParam("aliasName") String aliasName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Delete("/providers/Microsoft.Subscription/aliases/{aliasName}") + @ExpectedResponses({ 200, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response deleteSync(@HostParam("$host") String endpoint, @PathParam("aliasName") String aliasName, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Subscription/aliases") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Subscription/aliases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -123,94 +155,103 @@ private Mono>> createWithResponseAsync(String aliasNam } else { body.validate(); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), aliasName, apiVersion, body, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), aliasName, this.client.getApiVersion(), + body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. - * @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 subscription Information with the alias along with {@link Response} on successful completion of - * {@link Mono}. + * @return subscription Information with the alias along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String aliasName, PutAliasRequest body, - Context context) { + private Response createWithResponse(String aliasName, PutAliasRequest body) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (aliasName == null) { - return Mono.error(new IllegalArgumentException("Parameter aliasName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter aliasName is required and cannot be null.")); } if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); } else { body.validate(); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), aliasName, apiVersion, body, accept, context); + return service.createSync(this.client.getEndpoint(), aliasName, this.client.getApiVersion(), body, accept, + Context.NONE); } /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. + * @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 PollerFlux} for polling of subscription Information with the alias. + * @return subscription Information with the alias along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PutAliasResponseInner> beginCreateAsync(String aliasName, - PutAliasRequest body) { - Mono>> mono = createWithResponseAsync(aliasName, body); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), PutAliasResponseInner.class, PutAliasResponseInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String aliasName, PutAliasRequest body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (aliasName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter aliasName is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), aliasName, this.client.getApiVersion(), body, accept, + context); } /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. - * @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 PollerFlux} for polling of subscription Information with the alias. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, PutAliasResponseInner> beginCreateAsync(String aliasName, - PutAliasRequest body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = createWithResponseAsync(aliasName, body, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), PutAliasResponseInner.class, PutAliasResponseInner.class, context); + private PollerFlux, SubscriptionAliasResponseInner> + beginCreateAsync(String aliasName, PutAliasRequest body) { + Mono>> mono = createWithResponseAsync(aliasName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), SubscriptionAliasResponseInner.class, SubscriptionAliasResponseInner.class, + this.client.getContext()); } /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -218,16 +259,18 @@ private PollerFlux, PutAliasResponseInner> beg * @return the {@link SyncPoller} for polling of subscription Information with the alias. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PutAliasResponseInner> beginCreate(String aliasName, - PutAliasRequest body) { - return this.beginCreateAsync(aliasName, body).getSyncPoller(); + public SyncPoller, SubscriptionAliasResponseInner> + beginCreate(String aliasName, PutAliasRequest body) { + Response response = createWithResponse(aliasName, body); + return this.client.getLroResult(response, + SubscriptionAliasResponseInner.class, SubscriptionAliasResponseInner.class, Context.NONE); } /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -236,16 +279,18 @@ public SyncPoller, PutAliasResponseInner> begi * @return the {@link SyncPoller} for polling of subscription Information with the alias. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, PutAliasResponseInner> beginCreate(String aliasName, - PutAliasRequest body, Context context) { - return this.beginCreateAsync(aliasName, body, context).getSyncPoller(); + public SyncPoller, SubscriptionAliasResponseInner> + beginCreate(String aliasName, PutAliasRequest body, Context context) { + Response response = createWithResponse(aliasName, body, context); + return this.client.getLroResult(response, + SubscriptionAliasResponseInner.class, SubscriptionAliasResponseInner.class, context); } /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -253,32 +298,15 @@ public SyncPoller, PutAliasResponseInner> begi * @return subscription Information with the alias on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String aliasName, PutAliasRequest body) { + private Mono createAsync(String aliasName, PutAliasRequest body) { return beginCreateAsync(aliasName, body).last().flatMap(this.client::getLroFinalResultOrError); } /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. - * @param body The body parameter. - * @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 subscription Information with the alias on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String aliasName, PutAliasRequest body, Context context) { - return beginCreateAsync(aliasName, body, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Create Alias Subscription. - * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -286,15 +314,15 @@ private Mono createAsync(String aliasName, PutAliasReques * @return subscription Information with the alias. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PutAliasResponseInner create(String aliasName, PutAliasRequest body) { - return createAsync(aliasName, body).block(); + public SubscriptionAliasResponseInner create(String aliasName, PutAliasRequest body) { + return beginCreate(aliasName, body).getFinalResult(); } /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -303,22 +331,22 @@ public PutAliasResponseInner create(String aliasName, PutAliasRequest body) { * @return subscription Information with the alias. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PutAliasResponseInner create(String aliasName, PutAliasRequest body, Context context) { - return createAsync(aliasName, body, context).block(); + public SubscriptionAliasResponseInner create(String aliasName, PutAliasRequest body, Context context) { + return beginCreate(aliasName, body, context).getFinalResult(); } /** * Get Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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 alias Subscription along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String aliasName) { + private Mono> getWithResponseAsync(String aliasName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -326,59 +354,32 @@ private Mono> getWithResponseAsync(String aliasN if (aliasName == null) { return Mono.error(new IllegalArgumentException("Parameter aliasName is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), aliasName, apiVersion, accept, context)) + return FluxUtil.withContext( + context -> service.get(this.client.getEndpoint(), aliasName, this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. - * @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 alias Subscription along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String aliasName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (aliasName == null) { - return Mono.error(new IllegalArgumentException("Parameter aliasName is required and cannot be null.")); - } - final String apiVersion = "2020-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), aliasName, apiVersion, accept, context); - } - - /** - * Get Alias Subscription. - * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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 alias Subscription on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String aliasName) { + private Mono getAsync(String aliasName) { return getWithResponseAsync(aliasName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -386,30 +387,40 @@ private Mono getAsync(String aliasName) { * @return alias Subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String aliasName, Context context) { - return getWithResponseAsync(aliasName, context).block(); + public Response getWithResponse(String aliasName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (aliasName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter aliasName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getSync(this.client.getEndpoint(), aliasName, this.client.getApiVersion(), accept, context); } /** * Get Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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 alias Subscription. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PutAliasResponseInner get(String aliasName) { + public SubscriptionAliasResponseInner get(String aliasName) { return getWithResponse(aliasName, Context.NONE).getValue(); } /** * Delete Alias. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -424,44 +435,18 @@ private Mono> deleteWithResponseAsync(String aliasName) { if (aliasName == null) { return Mono.error(new IllegalArgumentException("Parameter aliasName is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), aliasName, apiVersion, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), aliasName, this.client.getApiVersion(), + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Delete Alias. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. - * @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} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String aliasName, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (aliasName == null) { - return Mono.error(new IllegalArgumentException("Parameter aliasName is required and cannot be null.")); - } - final String apiVersion = "2020-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), aliasName, apiVersion, accept, context); - } - - /** - * Delete Alias. - * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -475,8 +460,8 @@ private Mono deleteAsync(String aliasName) { /** * Delete Alias. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -485,14 +470,24 @@ private Mono deleteAsync(String aliasName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public Response deleteWithResponse(String aliasName, Context context) { - return deleteWithResponseAsync(aliasName, context).block(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (aliasName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter aliasName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), aliasName, this.client.getApiVersion(), accept, context); } /** * Delete Alias. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -503,80 +498,68 @@ public void delete(String aliasName) { } /** - * Get Alias Subscription. + * List Alias 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 alias Subscription along with {@link Response} on successful completion of {@link Mono}. + * @return the list of aliases along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { + private Mono> listWithResponseAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get Alias 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 alias Subscription along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2020-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context); - } - - /** - * Get Alias Subscription. + * List Alias 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 alias Subscription on successful completion of {@link Mono}. + * @return the list of aliases on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { + private Mono listAsync() { return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get Alias Subscription. + * List Alias 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 alias Subscription along with {@link Response}. + * @return the list of aliases along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + public Response listWithResponse(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); } /** - * Get Alias Subscription. + * List Alias 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 alias Subscription. + * @return the list of aliases. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PutAliasListResultInner list() { + public SubscriptionAliasListResultInner list() { return listWithResponse(Context.NONE).getValue(); } + + private static final ClientLogger LOGGER = new ClientLogger(AliasClientImpl.class); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AliasImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AliasImpl.java index 342bbe61a17a..e967e3d21d85 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AliasImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/AliasImpl.java @@ -9,12 +9,12 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.subscription.fluent.AliasClient; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasListResultInner; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasResponseInner; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasListResultInner; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasResponseInner; import com.azure.resourcemanager.subscription.models.Alias; -import com.azure.resourcemanager.subscription.models.PutAliasListResult; import com.azure.resourcemanager.subscription.models.PutAliasRequest; -import com.azure.resourcemanager.subscription.models.PutAliasResponse; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasListResult; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasResponse; public final class AliasImpl implements Alias { private static final ClientLogger LOGGER = new ClientLogger(AliasImpl.class); @@ -29,38 +29,38 @@ public AliasImpl(AliasClient innerClient, this.serviceManager = serviceManager; } - public PutAliasResponse create(String aliasName, PutAliasRequest body) { - PutAliasResponseInner inner = this.serviceClient().create(aliasName, body); + public SubscriptionAliasResponse create(String aliasName, PutAliasRequest body) { + SubscriptionAliasResponseInner inner = this.serviceClient().create(aliasName, body); if (inner != null) { - return new PutAliasResponseImpl(inner, this.manager()); + return new SubscriptionAliasResponseImpl(inner, this.manager()); } else { return null; } } - public PutAliasResponse create(String aliasName, PutAliasRequest body, Context context) { - PutAliasResponseInner inner = this.serviceClient().create(aliasName, body, context); + public SubscriptionAliasResponse create(String aliasName, PutAliasRequest body, Context context) { + SubscriptionAliasResponseInner inner = this.serviceClient().create(aliasName, body, context); if (inner != null) { - return new PutAliasResponseImpl(inner, this.manager()); + return new SubscriptionAliasResponseImpl(inner, this.manager()); } else { return null; } } - public Response getWithResponse(String aliasName, Context context) { - Response inner = this.serviceClient().getWithResponse(aliasName, context); + public Response getWithResponse(String aliasName, Context context) { + Response inner = this.serviceClient().getWithResponse(aliasName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PutAliasResponseImpl(inner.getValue(), this.manager())); + new SubscriptionAliasResponseImpl(inner.getValue(), this.manager())); } else { return null; } } - public PutAliasResponse get(String aliasName) { - PutAliasResponseInner inner = this.serviceClient().get(aliasName); + public SubscriptionAliasResponse get(String aliasName) { + SubscriptionAliasResponseInner inner = this.serviceClient().get(aliasName); if (inner != null) { - return new PutAliasResponseImpl(inner, this.manager()); + return new SubscriptionAliasResponseImpl(inner, this.manager()); } else { return null; } @@ -74,20 +74,20 @@ public void delete(String aliasName) { this.serviceClient().delete(aliasName); } - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); + public Response listWithResponse(Context context) { + Response inner = this.serviceClient().listWithResponse(context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new PutAliasListResultImpl(inner.getValue(), this.manager())); + new SubscriptionAliasListResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public PutAliasListResult list() { - PutAliasListResultInner inner = this.serviceClient().list(); + public SubscriptionAliasListResult list() { + SubscriptionAliasListResultInner inner = this.serviceClient().list(); if (inner != null) { - return new PutAliasListResultImpl(inner, this.manager()); + return new SubscriptionAliasListResultImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/BillingAccountPoliciesResponseImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/BillingAccountPoliciesResponseImpl.java new file mode 100644 index 000000000000..92a623137bdd --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/BillingAccountPoliciesResponseImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.subscription.fluent.models.BillingAccountPoliciesResponseInner; +import com.azure.resourcemanager.subscription.models.BillingAccountPoliciesResponse; +import com.azure.resourcemanager.subscription.models.BillingAccountPoliciesResponseProperties; + +public final class BillingAccountPoliciesResponseImpl implements BillingAccountPoliciesResponse { + private BillingAccountPoliciesResponseInner innerObject; + + private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; + + BillingAccountPoliciesResponseImpl(BillingAccountPoliciesResponseInner innerObject, + com.azure.resourcemanager.subscription.SubscriptionManager 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 BillingAccountPoliciesResponseProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public BillingAccountPoliciesResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.subscription.SubscriptionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/BillingAccountsClientImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/BillingAccountsClientImpl.java new file mode 100644 index 000000000000..bf6d77f104be --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/BillingAccountsClientImpl.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.core.util.logging.ClientLogger; +import com.azure.resourcemanager.subscription.fluent.BillingAccountsClient; +import com.azure.resourcemanager.subscription.fluent.models.BillingAccountPoliciesResponseInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in BillingAccountsClient. + */ +public final class BillingAccountsClientImpl implements BillingAccountsClient { + /** + * The proxy service used to perform REST calls. + */ + private final BillingAccountsService service; + + /** + * The service client containing this operation class. + */ + private final SubscriptionClientImpl client; + + /** + * Initializes an instance of BillingAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + BillingAccountsClientImpl(SubscriptionClientImpl client) { + this.service + = RestProxy.create(BillingAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SubscriptionClientBillingAccounts to be used by the proxy service to + * perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SubscriptionClientBillingAccounts") + public interface BillingAccountsService { + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPolicy(@HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.Subscription/policies/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getPolicySync(@HostParam("$host") String endpoint, + @PathParam("billingAccountId") String billingAccountId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get Billing Account Policy. + * + * @param billingAccountId Billing Account Id. + * @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 billing Account Policy along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPolicyWithResponseAsync(String billingAccountId) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + return Mono + .error(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getPolicy(this.client.getEndpoint(), billingAccountId, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Billing Account Policy. + * + * @param billingAccountId Billing Account Id. + * @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 billing Account Policy on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPolicyAsync(String billingAccountId) { + return getPolicyWithResponseAsync(billingAccountId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Billing Account Policy. + * + * @param billingAccountId Billing Account Id. + * @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 billing Account Policy along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPolicyWithResponse(String billingAccountId, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (billingAccountId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter billingAccountId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getPolicySync(this.client.getEndpoint(), billingAccountId, this.client.getApiVersion(), accept, + context); + } + + /** + * Get Billing Account Policy. + * + * @param billingAccountId Billing Account Id. + * @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 billing Account Policy. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BillingAccountPoliciesResponseInner getPolicy(String billingAccountId) { + return getPolicyWithResponse(billingAccountId, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(BillingAccountsClientImpl.class); +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/BillingAccountsImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/BillingAccountsImpl.java new file mode 100644 index 000000000000..2bb487ede149 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/BillingAccountsImpl.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.fluent.BillingAccountsClient; +import com.azure.resourcemanager.subscription.fluent.models.BillingAccountPoliciesResponseInner; +import com.azure.resourcemanager.subscription.models.BillingAccountPoliciesResponse; +import com.azure.resourcemanager.subscription.models.BillingAccounts; + +public final class BillingAccountsImpl implements BillingAccounts { + private static final ClientLogger LOGGER = new ClientLogger(BillingAccountsImpl.class); + + private final BillingAccountsClient innerClient; + + private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; + + public BillingAccountsImpl(BillingAccountsClient innerClient, + com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response getPolicyWithResponse(String billingAccountId, Context context) { + Response inner + = this.serviceClient().getPolicyWithResponse(billingAccountId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new BillingAccountPoliciesResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public BillingAccountPoliciesResponse getPolicy(String billingAccountId) { + BillingAccountPoliciesResponseInner inner = this.serviceClient().getPolicy(billingAccountId); + if (inner != null) { + return new BillingAccountPoliciesResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + private BillingAccountsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.subscription.SubscriptionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/PutAliasResponseImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/GetTenantPolicyResponseImpl.java similarity index 58% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/PutAliasResponseImpl.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/GetTenantPolicyResponseImpl.java index fbbf30784329..eb1b70667b1e 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/PutAliasResponseImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/GetTenantPolicyResponseImpl.java @@ -4,16 +4,17 @@ package com.azure.resourcemanager.subscription.implementation; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasResponseInner; -import com.azure.resourcemanager.subscription.models.PutAliasResponse; -import com.azure.resourcemanager.subscription.models.PutAliasResponseProperties; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.subscription.fluent.models.GetTenantPolicyResponseInner; +import com.azure.resourcemanager.subscription.models.GetTenantPolicyResponse; +import com.azure.resourcemanager.subscription.models.TenantPolicy; -public final class PutAliasResponseImpl implements PutAliasResponse { - private PutAliasResponseInner innerObject; +public final class GetTenantPolicyResponseImpl implements GetTenantPolicyResponse { + private GetTenantPolicyResponseInner innerObject; private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; - PutAliasResponseImpl(PutAliasResponseInner innerObject, + GetTenantPolicyResponseImpl(GetTenantPolicyResponseInner innerObject, com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; @@ -31,11 +32,15 @@ public String type() { return this.innerModel().type(); } - public PutAliasResponseProperties properties() { + public TenantPolicy properties() { return this.innerModel().properties(); } - public PutAliasResponseInner innerModel() { + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public GetTenantPolicyResponseInner innerModel() { return this.innerObject; } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/LocationImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/LocationImpl.java deleted file mode 100644 index 73aa8d012c81..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/LocationImpl.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.implementation; - -import com.azure.resourcemanager.subscription.fluent.models.LocationInner; -import com.azure.resourcemanager.subscription.models.Location; - -public final class LocationImpl implements Location { - private LocationInner innerObject; - - private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; - - LocationImpl(LocationInner innerObject, com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String subscriptionId() { - return this.innerModel().subscriptionId(); - } - - public String name() { - return this.innerModel().name(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String latitude() { - return this.innerModel().latitude(); - } - - public String longitude() { - return this.innerModel().longitude(); - } - - public LocationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.subscription.SubscriptionManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationListResultImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationImpl.java similarity index 52% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationListResultImpl.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationImpl.java index 5fa68bda8133..0d0a24b868f5 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationListResultImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationImpl.java @@ -4,37 +4,34 @@ package com.azure.resourcemanager.subscription.implementation; -import com.azure.resourcemanager.subscription.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.subscription.fluent.models.OperationInner; import com.azure.resourcemanager.subscription.models.Operation; -import com.azure.resourcemanager.subscription.models.OperationListResult; -import java.util.Collections; -import java.util.List; +import com.azure.resourcemanager.subscription.models.OperationDisplay; -public final class OperationListResultImpl implements OperationListResult { - private OperationListResultInner innerObject; +public final class OperationImpl implements Operation { + private OperationInner innerObject; private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; - OperationListResultImpl(OperationListResultInner innerObject, + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public List value() { - List inner = this.innerModel().value(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } + public String name() { + return this.innerModel().name(); } - public String nextLink() { - return this.innerModel().nextLink(); + public Boolean isDataAction() { + return this.innerModel().isDataAction(); } - public OperationListResultInner innerModel() { + public OperationDisplay display() { + return this.innerModel().display(); + } + + public OperationInner innerModel() { return this.innerObject; } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationsClientImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationsClientImpl.java index d55b1a2da3b6..a27879889427 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationsClientImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationsClientImpl.java @@ -10,18 +10,25 @@ 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.core.util.logging.ClientLogger; import com.azure.resourcemanager.subscription.fluent.OperationsClient; -import com.azure.resourcemanager.subscription.fluent.models.OperationListResultInner; +import com.azure.resourcemanager.subscription.fluent.models.OperationInner; +import com.azure.resourcemanager.subscription.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -54,14 +61,35 @@ public final class OperationsClientImpl implements OperationsClient { * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "SubscriptionClientOp") + @ServiceInterface(name = "SubscriptionClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.Subscription/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Subscription/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @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("$host") 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("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -69,21 +97,57 @@ Mono> list(@HostParam("$host") String endpoin * * @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 result of the request to list operations along with {@link Response} on successful completion of + * @return result of the request to list operations along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync() { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) + return FluxUtil + .withContext( + context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), 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 all of the available Microsoft.Subscription API operations. + * + * @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 result of the request to list operations as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all of the available Microsoft.Subscription API operations. + * + * @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 result of the request to list operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Lists all of the available Microsoft.Subscription API operations. * @@ -91,19 +155,20 @@ private Mono> listWithResponseAsync() { * @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 result of the request to list operations along with {@link Response} on successful completion of - * {@link Mono}. + * @return result of the request to list operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listWithResponseAsync(Context context) { + private PagedResponse listSinglePage(Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context); + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -111,11 +176,11 @@ private Mono> listWithResponseAsync(Context c * * @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 result of the request to list operations on successful completion of {@link Mono}. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono listAsync() { - return listWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -125,22 +190,92 @@ private Mono listAsync() { * @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 result of the request to list operations along with {@link Response}. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(() -> listSinglePage(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 result of the request to list operations along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response listWithResponse(Context context) { - return listWithResponseAsync(context).block(); + private Mono> listNextSinglePageAsync(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.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())); } /** - * Lists all of the available Microsoft.Subscription API operations. + * 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 result of the request to list operations. + * @return result of the request to list operations along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationListResultInner list() { - return listWithResponse(Context.NONE).getValue(); + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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 result of the request to list operations along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + 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); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationsImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationsImpl.java index 2f20acbcb44b..f2763dab2576 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationsImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/OperationsImpl.java @@ -4,13 +4,12 @@ package com.azure.resourcemanager.subscription.implementation; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.subscription.fluent.OperationsClient; -import com.azure.resourcemanager.subscription.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.subscription.models.OperationListResult; +import com.azure.resourcemanager.subscription.fluent.models.OperationInner; +import com.azure.resourcemanager.subscription.models.Operation; import com.azure.resourcemanager.subscription.models.Operations; public final class OperationsImpl implements Operations { @@ -26,23 +25,14 @@ public OperationsImpl(OperationsClient innerClient, this.serviceManager = serviceManager; } - public Response listWithResponse(Context context) { - Response inner = this.serviceClient().listWithResponse(context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationListResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable list() { + PagedIterable inner = this.serviceClient().list(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } - public OperationListResult list() { - OperationListResultInner inner = this.serviceClient().list(); - if (inner != null) { - return new OperationListResultImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable list(Context context) { + PagedIterable inner = this.serviceClient().list(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); } private OperationsClient serviceClient() { diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/PutAliasListResultImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionAliasListResultImpl.java similarity index 54% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/PutAliasListResultImpl.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionAliasListResultImpl.java index aad5acf1a9e2..ca88e9fb9cc1 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/PutAliasListResultImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionAliasListResultImpl.java @@ -4,30 +4,30 @@ package com.azure.resourcemanager.subscription.implementation; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasListResultInner; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasResponseInner; -import com.azure.resourcemanager.subscription.models.PutAliasListResult; -import com.azure.resourcemanager.subscription.models.PutAliasResponse; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasListResultInner; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasResponseInner; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasListResult; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasResponse; import java.util.Collections; import java.util.List; import java.util.stream.Collectors; -public final class PutAliasListResultImpl implements PutAliasListResult { - private PutAliasListResultInner innerObject; +public final class SubscriptionAliasListResultImpl implements SubscriptionAliasListResult { + private SubscriptionAliasListResultInner innerObject; private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; - PutAliasListResultImpl(PutAliasListResultInner innerObject, + SubscriptionAliasListResultImpl(SubscriptionAliasListResultInner innerObject, com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } - public List value() { - List inner = this.innerModel().value(); + public List value() { + List inner = this.innerModel().value(); if (inner != null) { return Collections.unmodifiableList(inner.stream() - .map(inner1 -> new PutAliasResponseImpl(inner1, this.manager())) + .map(inner1 -> new SubscriptionAliasResponseImpl(inner1, this.manager())) .collect(Collectors.toList())); } else { return Collections.emptyList(); @@ -38,7 +38,7 @@ public String nextLink() { return this.innerModel().nextLink(); } - public PutAliasListResultInner innerModel() { + public SubscriptionAliasListResultInner innerModel() { return this.innerObject; } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionAliasResponseImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionAliasResponseImpl.java new file mode 100644 index 000000000000..9312d97b1af0 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionAliasResponseImpl.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.implementation; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasResponseInner; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasResponse; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasResponseProperties; + +public final class SubscriptionAliasResponseImpl implements SubscriptionAliasResponse { + private SubscriptionAliasResponseInner innerObject; + + private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; + + SubscriptionAliasResponseImpl(SubscriptionAliasResponseInner innerObject, + com.azure.resourcemanager.subscription.SubscriptionManager 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 SubscriptionAliasResponseProperties properties() { + return this.innerModel().properties(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + + public SubscriptionAliasResponseInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.subscription.SubscriptionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionClientImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionClientImpl.java index fa87e26d40b4..889452607bc0 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionClientImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionClientImpl.java @@ -15,20 +15,24 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.subscription.fluent.AliasClient; +import com.azure.resourcemanager.subscription.fluent.BillingAccountsClient; import com.azure.resourcemanager.subscription.fluent.OperationsClient; import com.azure.resourcemanager.subscription.fluent.SubscriptionClient; import com.azure.resourcemanager.subscription.fluent.SubscriptionOperationsClient; +import com.azure.resourcemanager.subscription.fluent.SubscriptionPoliciesClient; import com.azure.resourcemanager.subscription.fluent.SubscriptionsClient; -import com.azure.resourcemanager.subscription.fluent.TenantsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -57,6 +61,20 @@ public String getEndpoint() { return this.endpoint; } + /** + * Api Version. + */ + private final String apiVersion; + + /** + * Gets Api Version. + * + * @return the apiVersion value. + */ + public String getApiVersion() { + return this.apiVersion; + } + /** * The HTTP pipeline to send requests through. */ @@ -113,20 +131,6 @@ public SubscriptionsClient getSubscriptions() { return this.subscriptions; } - /** - * The TenantsClient object to access its operations. - */ - private final TenantsClient tenants; - - /** - * Gets the TenantsClient object to access its operations. - * - * @return the TenantsClient object. - */ - public TenantsClient getTenants() { - return this.tenants; - } - /** * The SubscriptionOperationsClient object to access its operations. */ @@ -169,6 +173,34 @@ public AliasClient getAlias() { return this.alias; } + /** + * The SubscriptionPoliciesClient object to access its operations. + */ + private final SubscriptionPoliciesClient subscriptionPolicies; + + /** + * Gets the SubscriptionPoliciesClient object to access its operations. + * + * @return the SubscriptionPoliciesClient object. + */ + public SubscriptionPoliciesClient getSubscriptionPolicies() { + return this.subscriptionPolicies; + } + + /** + * The BillingAccountsClient object to access its operations. + */ + private final BillingAccountsClient billingAccounts; + + /** + * Gets the BillingAccountsClient object to access its operations. + * + * @return the BillingAccountsClient object. + */ + public BillingAccountsClient getBillingAccounts() { + return this.billingAccounts; + } + /** * Initializes an instance of SubscriptionClient client. * @@ -184,11 +216,13 @@ public AliasClient getAlias() { this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; this.endpoint = endpoint; + this.apiVersion = "2021-10-01"; this.subscriptions = new SubscriptionsClientImpl(this); - this.tenants = new TenantsClientImpl(this); this.subscriptionOperations = new SubscriptionOperationsClientImpl(this); this.operations = new OperationsClientImpl(this); this.alias = new AliasClientImpl(this); + this.subscriptionPolicies = new SubscriptionPoliciesClientImpl(this); + this.billingAccounts = new BillingAccountsClientImpl(this); } /** @@ -228,6 +262,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionCreationResultImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionCreationResultImpl.java new file mode 100644 index 000000000000..907c118c2ed1 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionCreationResultImpl.java @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.implementation; + +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionCreationResultInner; +import com.azure.resourcemanager.subscription.models.SubscriptionCreationResult; + +public final class SubscriptionCreationResultImpl implements SubscriptionCreationResult { + private SubscriptionCreationResultInner innerObject; + + private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; + + SubscriptionCreationResultImpl(SubscriptionCreationResultInner innerObject, + com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { + this.innerObject = innerObject; + this.serviceManager = serviceManager; + } + + public String subscriptionLink() { + return this.innerModel().subscriptionLink(); + } + + public SubscriptionCreationResultInner innerModel() { + return this.innerObject; + } + + private com.azure.resourcemanager.subscription.SubscriptionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionOperationsClientImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionOperationsClientImpl.java index 7d17ac77d61a..5f3f468cdd0f 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionOperationsClientImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionOperationsClientImpl.java @@ -4,29 +4,26 @@ package com.azure.resourcemanager.subscription.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.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.core.util.logging.ClientLogger; import com.azure.resourcemanager.subscription.fluent.SubscriptionOperationsClient; -import com.azure.resourcemanager.subscription.fluent.models.CanceledSubscriptionIdInner; -import com.azure.resourcemanager.subscription.fluent.models.EnabledSubscriptionIdInner; -import com.azure.resourcemanager.subscription.fluent.models.RenamedSubscriptionIdInner; -import com.azure.resourcemanager.subscription.models.SubscriptionName; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionCreationResultInner; +import com.azure.resourcemanager.subscription.models.SubscriptionOperationsGetResponse; import reactor.core.publisher.Mono; /** @@ -59,336 +56,106 @@ public final class SubscriptionOperationsClientImpl implements SubscriptionOpera * service to perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "SubscriptionClientSu") + @ServiceInterface(name = "SubscriptionClientSubscriptionOperations") public interface SubscriptionOperationsService { @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel") - @ExpectedResponses({ 200 }) + @Get("/providers/Microsoft.Subscription/subscriptionOperations/{operationId}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> cancel(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono get(@HostParam("$host") String endpoint, + @PathParam("operationId") String operationId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename") - @ExpectedResponses({ 200 }) + @Get("/providers/Microsoft.Subscription/subscriptionOperations/{operationId}") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> rename(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") SubscriptionName body, @HeaderParam("Accept") String accept, - Context context); - - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> enable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + SubscriptionOperationsGetResponse getSync(@HostParam("$host") String endpoint, + @PathParam("operationId") String operationId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); } /** - * The operation to cancel a subscription. + * Get the status of the pending Microsoft.Subscription API operations. * - * @param subscriptionId Subscription Id. + * @param operationId The operation ID, which can be found from the Location field in the generate recommendation + * response header. * @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 ID of the canceled subscription along with {@link Response} on successful completion of {@link Mono}. + * @return the status of the pending Microsoft.Subscription API operations on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelWithResponseAsync(String subscriptionId) { + private Mono getWithResponseAsync(String operationId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + if (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.cancel(this.client.getEndpoint(), subscriptionId, apiVersion, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), operationId, this.client.getApiVersion(), + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * The operation to cancel a subscription. - * - * @param subscriptionId Subscription Id. - * @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 ID of the canceled subscription along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelWithResponseAsync(String subscriptionId, - Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String apiVersion = "2020-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.cancel(this.client.getEndpoint(), subscriptionId, apiVersion, accept, context); - } - - /** - * The operation to cancel a subscription. - * - * @param subscriptionId Subscription Id. - * @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 ID of the canceled subscription on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cancelAsync(String subscriptionId) { - return cancelWithResponseAsync(subscriptionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The operation to cancel a subscription. - * - * @param subscriptionId Subscription Id. - * @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 ID of the canceled subscription along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelWithResponse(String subscriptionId, Context context) { - return cancelWithResponseAsync(subscriptionId, context).block(); - } - - /** - * The operation to cancel a subscription. - * - * @param subscriptionId Subscription Id. - * @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 ID of the canceled subscription. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CanceledSubscriptionIdInner cancel(String subscriptionId) { - return cancelWithResponse(subscriptionId, Context.NONE).getValue(); - } - - /** - * The operation to rename a subscription. - * - * @param subscriptionId Subscription Id. - * @param body Subscription 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 ID of the subscriptions that is being renamed along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> renameWithResponseAsync(String subscriptionId, - SubscriptionName body) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-09-01"; - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.rename(this.client.getEndpoint(), subscriptionId, apiVersion, body, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * The operation to rename a subscription. - * - * @param subscriptionId Subscription Id. - * @param body Subscription 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 ID of the subscriptions that is being renamed along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> renameWithResponseAsync(String subscriptionId, - SubscriptionName body, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String apiVersion = "2020-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.rename(this.client.getEndpoint(), subscriptionId, apiVersion, body, accept, context); - } - - /** - * The operation to rename a subscription. + * Get the status of the pending Microsoft.Subscription API operations. * - * @param subscriptionId Subscription Id. - * @param body Subscription Name. + * @param operationId The operation ID, which can be found from the Location field in the generate recommendation + * response header. * @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 ID of the subscriptions that is being renamed on successful completion of {@link Mono}. + * @return the status of the pending Microsoft.Subscription API operations on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono renameAsync(String subscriptionId, SubscriptionName body) { - return renameWithResponseAsync(subscriptionId, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String operationId) { + return getWithResponseAsync(operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * The operation to rename a subscription. + * Get the status of the pending Microsoft.Subscription API operations. * - * @param subscriptionId Subscription Id. - * @param body Subscription Name. + * @param operationId The operation ID, which can be found from the Location field in the generate recommendation + * response header. * @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 ID of the subscriptions that is being renamed along with {@link Response}. + * @return the status of the pending Microsoft.Subscription API operations. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response renameWithResponse(String subscriptionId, SubscriptionName body, - Context context) { - return renameWithResponseAsync(subscriptionId, body, context).block(); - } - - /** - * The operation to rename a subscription. - * - * @param subscriptionId Subscription Id. - * @param body Subscription 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 ID of the subscriptions that is being renamed. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public RenamedSubscriptionIdInner rename(String subscriptionId, SubscriptionName body) { - return renameWithResponse(subscriptionId, body, Context.NONE).getValue(); - } - - /** - * The operation to enable a subscription. - * - * @param subscriptionId Subscription Id. - * @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 ID of the subscriptions that is being enabled along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> enableWithResponseAsync(String subscriptionId) { + public SubscriptionOperationsGetResponse getWithResponse(String operationId, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + if (operationId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); } - final String apiVersion = "2020-09-01"; final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.enable(this.client.getEndpoint(), subscriptionId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + return service.getSync(this.client.getEndpoint(), operationId, this.client.getApiVersion(), accept, context); } /** - * The operation to enable a subscription. + * Get the status of the pending Microsoft.Subscription API operations. * - * @param subscriptionId Subscription Id. - * @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 ID of the subscriptions that is being enabled along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> enableWithResponseAsync(String subscriptionId, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String apiVersion = "2020-09-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.enable(this.client.getEndpoint(), subscriptionId, apiVersion, accept, context); - } - - /** - * The operation to enable a subscription. - * - * @param subscriptionId Subscription Id. - * @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 ID of the subscriptions that is being enabled on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono enableAsync(String subscriptionId) { - return enableWithResponseAsync(subscriptionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The operation to enable a subscription. - * - * @param subscriptionId Subscription Id. - * @param context The context to associate with this operation. + * @param operationId The operation ID, which can be found from the Location field in the generate recommendation + * response header. * @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 ID of the subscriptions that is being enabled along with {@link Response}. + * @return the status of the pending Microsoft.Subscription API operations. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response enableWithResponse(String subscriptionId, Context context) { - return enableWithResponseAsync(subscriptionId, context).block(); + public SubscriptionCreationResultInner get(String operationId) { + return getWithResponse(operationId, Context.NONE).getValue(); } - /** - * The operation to enable a subscription. - * - * @param subscriptionId Subscription Id. - * @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 ID of the subscriptions that is being enabled. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public EnabledSubscriptionIdInner enable(String subscriptionId) { - return enableWithResponse(subscriptionId, Context.NONE).getValue(); - } + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionOperationsClientImpl.class); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionOperationsImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionOperationsImpl.java index 461a3a9fcfe2..459591569bb5 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionOperationsImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionOperationsImpl.java @@ -9,14 +9,10 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.subscription.fluent.SubscriptionOperationsClient; -import com.azure.resourcemanager.subscription.fluent.models.CanceledSubscriptionIdInner; -import com.azure.resourcemanager.subscription.fluent.models.EnabledSubscriptionIdInner; -import com.azure.resourcemanager.subscription.fluent.models.RenamedSubscriptionIdInner; -import com.azure.resourcemanager.subscription.models.CanceledSubscriptionId; -import com.azure.resourcemanager.subscription.models.EnabledSubscriptionId; -import com.azure.resourcemanager.subscription.models.RenamedSubscriptionId; -import com.azure.resourcemanager.subscription.models.SubscriptionName; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionCreationResultInner; +import com.azure.resourcemanager.subscription.models.SubscriptionCreationResult; import com.azure.resourcemanager.subscription.models.SubscriptionOperations; +import com.azure.resourcemanager.subscription.models.SubscriptionOperationsGetResponse; public final class SubscriptionOperationsImpl implements SubscriptionOperations { private static final ClientLogger LOGGER = new ClientLogger(SubscriptionOperationsImpl.class); @@ -31,60 +27,20 @@ public SubscriptionOperationsImpl(SubscriptionOperationsClient innerClient, this.serviceManager = serviceManager; } - public Response cancelWithResponse(String subscriptionId, Context context) { - Response inner = this.serviceClient().cancelWithResponse(subscriptionId, context); + public Response getWithResponse(String operationId, Context context) { + SubscriptionOperationsGetResponse inner = this.serviceClient().getWithResponse(operationId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new CanceledSubscriptionIdImpl(inner.getValue(), this.manager())); + new SubscriptionCreationResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public CanceledSubscriptionId cancel(String subscriptionId) { - CanceledSubscriptionIdInner inner = this.serviceClient().cancel(subscriptionId); + public SubscriptionCreationResult get(String operationId) { + SubscriptionCreationResultInner inner = this.serviceClient().get(operationId); if (inner != null) { - return new CanceledSubscriptionIdImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response renameWithResponse(String subscriptionId, SubscriptionName body, - Context context) { - Response inner - = this.serviceClient().renameWithResponse(subscriptionId, body, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new RenamedSubscriptionIdImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public RenamedSubscriptionId rename(String subscriptionId, SubscriptionName body) { - RenamedSubscriptionIdInner inner = this.serviceClient().rename(subscriptionId, body); - if (inner != null) { - return new RenamedSubscriptionIdImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response enableWithResponse(String subscriptionId, Context context) { - Response inner = this.serviceClient().enableWithResponse(subscriptionId, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new EnabledSubscriptionIdImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public EnabledSubscriptionId enable(String subscriptionId) { - EnabledSubscriptionIdInner inner = this.serviceClient().enable(subscriptionId); - if (inner != null) { - return new EnabledSubscriptionIdImpl(inner, this.manager()); + return new SubscriptionCreationResultImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionPoliciesClientImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionPoliciesClientImpl.java new file mode 100644 index 000000000000..af1b59f7d5d4 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionPoliciesClientImpl.java @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.subscription.fluent.SubscriptionPoliciesClient; +import com.azure.resourcemanager.subscription.fluent.models.GetTenantPolicyResponseInner; +import com.azure.resourcemanager.subscription.models.GetTenantPolicyListResponse; +import com.azure.resourcemanager.subscription.models.PutTenantPolicyRequestProperties; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in SubscriptionPoliciesClient. + */ +public final class SubscriptionPoliciesClientImpl implements SubscriptionPoliciesClient { + /** + * The proxy service used to perform REST calls. + */ + private final SubscriptionPoliciesService service; + + /** + * The service client containing this operation class. + */ + private final SubscriptionClientImpl client; + + /** + * Initializes an instance of SubscriptionPoliciesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + SubscriptionPoliciesClientImpl(SubscriptionClientImpl client) { + this.service = RestProxy.create(SubscriptionPoliciesService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for SubscriptionClientSubscriptionPolicies to be used by the proxy + * service to perform REST calls. + */ + @Host("{$host}") + @ServiceInterface(name = "SubscriptionClientSubscriptionPolicies") + public interface SubscriptionPoliciesService { + @Headers({ "Content-Type: application/json" }) + @Put("/providers/Microsoft.Subscription/policies/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> addUpdatePolicyForTenant(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PutTenantPolicyRequestProperties body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Put("/providers/Microsoft.Subscription/policies/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response addUpdatePolicyForTenantSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") PutTenantPolicyRequestProperties body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Subscription/policies/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getPolicyForTenant(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Subscription/policies/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getPolicyForTenantSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Subscription/policies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPolicyForTenant(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Subscription/policies") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listPolicyForTenantSync(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listPolicyForTenantNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listPolicyForTenantNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Create or Update Subscription tenant policy for user's tenant. + * + * @param body The body parameter. + * @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 tenant policy Information along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + addUpdatePolicyForTenantWithResponseAsync(PutTenantPolicyRequestProperties body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.addUpdatePolicyForTenant(this.client.getEndpoint(), + this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or Update Subscription tenant policy for user's tenant. + * + * @param body The body parameter. + * @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 tenant policy Information on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono addUpdatePolicyForTenantAsync(PutTenantPolicyRequestProperties body) { + return addUpdatePolicyForTenantWithResponseAsync(body).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Create or Update Subscription tenant policy for user's tenant. + * + * @param body The body parameter. + * @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 tenant policy Information along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response + addUpdatePolicyForTenantWithResponse(PutTenantPolicyRequestProperties body, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.addUpdatePolicyForTenantSync(this.client.getEndpoint(), this.client.getApiVersion(), body, + accept, context); + } + + /** + * Create or Update Subscription tenant policy for user's tenant. + * + * @param body The body parameter. + * @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 tenant policy Information. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetTenantPolicyResponseInner addUpdatePolicyForTenant(PutTenantPolicyRequestProperties body) { + return addUpdatePolicyForTenantWithResponse(body, Context.NONE).getValue(); + } + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getPolicyForTenantWithResponseAsync() { + 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.getPolicyForTenant(this.client.getEndpoint(), this.client.getApiVersion(), + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getPolicyForTenantAsync() { + return getPolicyForTenantWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getPolicyForTenantWithResponse(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getPolicyForTenantSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + } + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GetTenantPolicyResponseInner getPolicyForTenant() { + return getPolicyForTenantWithResponse(Context.NONE).getValue(); + } + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPolicyForTenantSinglePageAsync() { + 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.listPolicyForTenant(this.client.getEndpoint(), this.client.getApiVersion(), + 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 subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listPolicyForTenantAsync() { + return new PagedFlux<>(() -> listPolicyForTenantSinglePageAsync(), + nextLink -> listPolicyForTenantNextSinglePageAsync(nextLink)); + } + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPolicyForTenantSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listPolicyForTenantSync(this.client.getEndpoint(), + this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPolicyForTenantSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listPolicyForTenantSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPolicyForTenant() { + return new PagedIterable<>(() -> listPolicyForTenantSinglePage(), + nextLink -> listPolicyForTenantNextSinglePage(nextLink)); + } + + /** + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listPolicyForTenant(Context context) { + return new PagedIterable<>(() -> listPolicyForTenantSinglePage(context), + nextLink -> listPolicyForTenantNextSinglePage(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 the subscription tenant policy for the user's tenant along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listPolicyForTenantNextSinglePageAsync(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.listPolicyForTenantNext(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 subscription tenant policy for the user's tenant along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPolicyForTenantNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listPolicyForTenantNextSync(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 subscription tenant policy for the user's tenant along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listPolicyForTenantNextSinglePage(String nextLink, + Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listPolicyForTenantNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionPoliciesClientImpl.class); +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionPoliciesImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionPoliciesImpl.java new file mode 100644 index 000000000000..b7d4b91d34e3 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionPoliciesImpl.java @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.fluent.SubscriptionPoliciesClient; +import com.azure.resourcemanager.subscription.fluent.models.GetTenantPolicyResponseInner; +import com.azure.resourcemanager.subscription.models.GetTenantPolicyResponse; +import com.azure.resourcemanager.subscription.models.PutTenantPolicyRequestProperties; +import com.azure.resourcemanager.subscription.models.SubscriptionPolicies; + +public final class SubscriptionPoliciesImpl implements SubscriptionPolicies { + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionPoliciesImpl.class); + + private final SubscriptionPoliciesClient innerClient; + + private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; + + public SubscriptionPoliciesImpl(SubscriptionPoliciesClient innerClient, + com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response addUpdatePolicyForTenantWithResponse(PutTenantPolicyRequestProperties body, + Context context) { + Response inner + = this.serviceClient().addUpdatePolicyForTenantWithResponse(body, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetTenantPolicyResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetTenantPolicyResponse addUpdatePolicyForTenant(PutTenantPolicyRequestProperties body) { + GetTenantPolicyResponseInner inner = this.serviceClient().addUpdatePolicyForTenant(body); + if (inner != null) { + return new GetTenantPolicyResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public Response getPolicyForTenantWithResponse(Context context) { + Response inner = this.serviceClient().getPolicyForTenantWithResponse(context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new GetTenantPolicyResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public GetTenantPolicyResponse getPolicyForTenant() { + GetTenantPolicyResponseInner inner = this.serviceClient().getPolicyForTenant(); + if (inner != null) { + return new GetTenantPolicyResponseImpl(inner, this.manager()); + } else { + return null; + } + } + + public PagedIterable listPolicyForTenant() { + PagedIterable inner = this.serviceClient().listPolicyForTenant(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GetTenantPolicyResponseImpl(inner1, this.manager())); + } + + public PagedIterable listPolicyForTenant(Context context) { + PagedIterable inner = this.serviceClient().listPolicyForTenant(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new GetTenantPolicyResponseImpl(inner1, this.manager())); + } + + private SubscriptionPoliciesClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.subscription.SubscriptionManager manager() { + return this.serviceManager; + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionsClientImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionsClientImpl.java index 87fd9ef2bbf4..d875f196d7fc 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionsClientImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionsClientImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.subscription.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; @@ -11,25 +12,31 @@ 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.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.subscription.fluent.SubscriptionsClient; -import com.azure.resourcemanager.subscription.fluent.models.LocationInner; -import com.azure.resourcemanager.subscription.fluent.models.SubscriptionInner; -import com.azure.resourcemanager.subscription.models.LocationListResult; -import com.azure.resourcemanager.subscription.models.SubscriptionListResult; +import com.azure.resourcemanager.subscription.fluent.models.AcceptOwnershipStatusResponseInner; +import com.azure.resourcemanager.subscription.fluent.models.CanceledSubscriptionIdInner; +import com.azure.resourcemanager.subscription.fluent.models.EnabledSubscriptionIdInner; +import com.azure.resourcemanager.subscription.fluent.models.RenamedSubscriptionIdInner; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequest; +import com.azure.resourcemanager.subscription.models.SubscriptionName; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; /** @@ -62,54 +69,104 @@ public final class SubscriptionsClientImpl implements SubscriptionsClient { * perform REST calls. */ @Host("{$host}") - @ServiceInterface(name = "SubscriptionClientSu") + @ServiceInterface(name = "SubscriptionClientSubscriptions") public interface SubscriptionsService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/locations") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listLocations(@HostParam("$host") String endpoint, + Mono> cancel(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/cancel") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, + Response cancelSync(@HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Mono> rename(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SubscriptionName body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/rename") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response renameSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") SubscriptionName body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> enable(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.Subscription/enable") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + Response enableSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnership") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> acceptOwnership(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AcceptOwnershipRequest body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnership") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response acceptOwnershipSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @BodyParam("application/json") AcceptOwnershipRequest body, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnershipStatus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> acceptOwnershipStatus(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.Subscription/subscriptions/{subscriptionId}/acceptOwnershipStatus") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response acceptOwnershipStatusSync(@HostParam("$host") String endpoint, + @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + @HeaderParam("Accept") String accept, Context context); } /** - * Gets all available geo-locations. - * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. + * The operation to cancel a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. * @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 location list operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the ID of the canceled subscription along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLocationsSinglePageAsync(String subscriptionId) { + private Mono> cancelWithResponseAsync(String subscriptionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -117,155 +174,175 @@ private Mono> listLocationsSinglePageAsync(String s if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String apiVersion = "2016-06-01"; final String accept = "application/json"; - return FluxUtil.withContext( - context -> service.listLocations(this.client.getEndpoint(), subscriptionId, apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), subscriptionId, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all available geo-locations. + * The operation to cancel a subscription. * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. + * @param subscriptionId Subscription Id. + * @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 ID of the canceled subscription on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono cancelAsync(String subscriptionId) { + return cancelWithResponseAsync(subscriptionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * The operation to cancel a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. * @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 location list operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return the ID of the canceled subscription along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listLocationsSinglePageAsync(String subscriptionId, Context context) { + public Response cancelWithResponse(String subscriptionId, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String apiVersion = "2016-06-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listLocations(this.client.getEndpoint(), subscriptionId, apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + return service.cancelSync(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), accept, + context); } /** - * Gets all available geo-locations. + * The operation to cancel a subscription. * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. * @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 location list operation response as paginated response with {@link PagedFlux}. + * @return the ID of the canceled subscription. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listLocationsAsync(String subscriptionId) { - return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId)); + @ServiceMethod(returns = ReturnType.SINGLE) + public CanceledSubscriptionIdInner cancel(String subscriptionId) { + return cancelWithResponse(subscriptionId, Context.NONE).getValue(); } /** - * Gets all available geo-locations. - * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. + * The operation to rename a subscription. * - * @param subscriptionId The ID of the target subscription. - * @param context The context to associate with this operation. + * @param subscriptionId Subscription Id. + * @param body Subscription 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 location list operation response as paginated response with {@link PagedFlux}. + * @return the ID of the subscriptions that is being renamed along with {@link Response} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listLocationsAsync(String subscriptionId, Context context) { - return new PagedFlux<>(() -> listLocationsSinglePageAsync(subscriptionId, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> renameWithResponseAsync(String subscriptionId, + SubscriptionName body) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.rename(this.client.getEndpoint(), subscriptionId, + this.client.getApiVersion(), body, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all available geo-locations. - * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. + * The operation to rename a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. + * @param body Subscription 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 location list operation response as paginated response with {@link PagedIterable}. + * @return the ID of the subscriptions that is being renamed on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLocations(String subscriptionId) { - return new PagedIterable<>(listLocationsAsync(subscriptionId)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono renameAsync(String subscriptionId, SubscriptionName body) { + return renameWithResponseAsync(subscriptionId, body).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets all available geo-locations. + * The operation to rename a subscription. * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. + * @param body Subscription 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 location list operation response as paginated response with {@link PagedIterable}. + * @return the ID of the subscriptions that is being renamed along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listLocations(String subscriptionId, Context context) { - return new PagedIterable<>(listLocationsAsync(subscriptionId, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response renameWithResponse(String subscriptionId, SubscriptionName body, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.renameSync(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), body, accept, + context); } /** - * Gets details about a specified subscription. + * The operation to rename a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. + * @param body Subscription 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 details about a specified subscription along with {@link Response} on successful completion of - * {@link Mono}. + * @return the ID of the subscriptions that is being renamed. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String subscriptionId) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (subscriptionId == null) { - return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); - } - final String apiVersion = "2016-06-01"; - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), subscriptionId, apiVersion, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public RenamedSubscriptionIdInner rename(String subscriptionId, SubscriptionName body) { + return renameWithResponse(subscriptionId, body, Context.NONE).getValue(); } /** - * Gets details about a specified subscription. + * The operation to enable a subscription. * - * @param subscriptionId The ID of the target subscription. - * @param context The context to associate with this operation. + * @param subscriptionId Subscription Id. * @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 details about a specified subscription along with {@link Response} on successful completion of + * @return the ID of the subscriptions that is being enabled along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String subscriptionId, Context context) { + private Mono> enableWithResponseAsync(String subscriptionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -273,202 +350,340 @@ private Mono> getWithResponseAsync(String subscripti if (subscriptionId == null) { return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } - final String apiVersion = "2016-06-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), subscriptionId, apiVersion, accept, context); + return FluxUtil + .withContext(context -> service.enable(this.client.getEndpoint(), subscriptionId, + this.client.getApiVersion(), accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets details about a specified subscription. + * The operation to enable a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. * @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 details about a specified subscription on successful completion of {@link Mono}. + * @return the ID of the subscriptions that is being enabled on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String subscriptionId) { - return getWithResponseAsync(subscriptionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono enableAsync(String subscriptionId) { + return enableWithResponseAsync(subscriptionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets details about a specified subscription. + * The operation to enable a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. * @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 details about a specified subscription along with {@link Response}. + * @return the ID of the subscriptions that is being enabled along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String subscriptionId, Context context) { - return getWithResponseAsync(subscriptionId, context).block(); + public Response enableWithResponse(String subscriptionId, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + final String accept = "application/json"; + return service.enableSync(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), accept, + context); } /** - * Gets details about a specified subscription. + * The operation to enable a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. * @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 details about a specified subscription. + * @return the ID of the subscriptions that is being enabled. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SubscriptionInner get(String subscriptionId) { - return getWithResponse(subscriptionId, Context.NONE).getValue(); + public EnabledSubscriptionIdInner enable(String subscriptionId) { + return enableWithResponse(subscriptionId, Context.NONE).getValue(); } /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership. * + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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 all subscriptions for a tenant along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + private Mono>> acceptOwnershipWithResponseAsync(String subscriptionId, + AcceptOwnershipRequest body) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - final String apiVersion = "2016-06-01"; + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + return FluxUtil + .withContext(context -> service.acceptOwnership(this.client.getEndpoint(), subscriptionId, + this.client.getApiVersion(), body, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership. * + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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 acceptOwnershipWithResponse(String subscriptionId, AcceptOwnershipRequest body) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String accept = "application/json"; + return service.acceptOwnershipSync(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), body, + accept, Context.NONE); + } + + /** + * Accept subscription ownership. + * + * @param subscriptionId Subscription Id. + * @param body The body parameter. * @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 all subscriptions for a tenant along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Response acceptOwnershipWithResponse(String subscriptionId, AcceptOwnershipRequest body, + Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } + if (body == null) { + throw LOGGER.atError().log(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); } - final String apiVersion = "2016-06-01"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + return service.acceptOwnershipSync(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), body, + accept, context); + } + + /** + * Accept subscription ownership. + * + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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> beginAcceptOwnershipAsync(String subscriptionId, + AcceptOwnershipRequest body) { + Mono>> mono = acceptOwnershipWithResponseAsync(subscriptionId, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership. * + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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 all subscriptions for a tenant as paginated response with {@link PagedFlux}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAcceptOwnership(String subscriptionId, AcceptOwnershipRequest body) { + Response response = acceptOwnershipWithResponse(subscriptionId, body); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership. * + * @param subscriptionId Subscription Id. + * @param body The body parameter. * @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 all subscriptions for a tenant as paginated response with {@link PagedFlux}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginAcceptOwnership(String subscriptionId, AcceptOwnershipRequest body, + Context context) { + Response response = acceptOwnershipWithResponse(subscriptionId, body, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership. * + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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 acceptOwnershipAsync(String subscriptionId, AcceptOwnershipRequest body) { + return beginAcceptOwnershipAsync(subscriptionId, body).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Accept subscription ownership. + * + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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 all subscriptions for a tenant as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public void acceptOwnership(String subscriptionId, AcceptOwnershipRequest body) { + beginAcceptOwnership(subscriptionId, body).getFinalResult(); } /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership. * + * @param subscriptionId Subscription Id. + * @param body The body parameter. * @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 all subscriptions for a tenant as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public void acceptOwnership(String subscriptionId, AcceptOwnershipRequest body, Context context) { + beginAcceptOwnership(subscriptionId, body, context).getFinalResult(); } /** - * Get the next page of items. + * Accept subscription ownership status. * - * @param nextLink The URL to get the next list of items. + * @param subscriptionId Subscription Id. * @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 subscription list operation response along with {@link PagedResponse} on successful completion of + * @return subscription Accept Ownership Response along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } + private Mono> + acceptOwnershipStatusWithResponseAsync(String subscriptionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (subscriptionId == null) { + return Mono.error(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); + } 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)) + return FluxUtil + .withContext(context -> service.acceptOwnershipStatus(this.client.getEndpoint(), subscriptionId, + this.client.getApiVersion(), accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the next page of items. + * Accept subscription ownership status. * - * @param nextLink The URL to get the next list of items. + * @param subscriptionId Subscription Id. + * @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 subscription Accept Ownership Response on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono acceptOwnershipStatusAsync(String subscriptionId) { + return acceptOwnershipStatusWithResponseAsync(subscriptionId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Accept subscription ownership status. + * + * @param subscriptionId Subscription Id. * @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 subscription list operation response along with {@link PagedResponse} on successful completion of - * {@link Mono}. + * @return subscription Accept Ownership Response along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } + public Response acceptOwnershipStatusWithResponse(String subscriptionId, + Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (subscriptionId == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter subscriptionId is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return 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)); + return service.acceptOwnershipStatusSync(this.client.getEndpoint(), subscriptionId, this.client.getApiVersion(), + accept, context); } + + /** + * Accept subscription ownership status. + * + * @param subscriptionId Subscription Id. + * @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 subscription Accept Ownership Response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public AcceptOwnershipStatusResponseInner acceptOwnershipStatus(String subscriptionId) { + return acceptOwnershipStatusWithResponse(subscriptionId, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(SubscriptionsClientImpl.class); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionsImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionsImpl.java index 7d18bb790bc2..94aeac190529 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionsImpl.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/SubscriptionsImpl.java @@ -4,16 +4,21 @@ package com.azure.resourcemanager.subscription.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.subscription.fluent.SubscriptionsClient; -import com.azure.resourcemanager.subscription.fluent.models.LocationInner; -import com.azure.resourcemanager.subscription.fluent.models.SubscriptionInner; -import com.azure.resourcemanager.subscription.models.Location; -import com.azure.resourcemanager.subscription.models.Subscription; +import com.azure.resourcemanager.subscription.fluent.models.AcceptOwnershipStatusResponseInner; +import com.azure.resourcemanager.subscription.fluent.models.CanceledSubscriptionIdInner; +import com.azure.resourcemanager.subscription.fluent.models.EnabledSubscriptionIdInner; +import com.azure.resourcemanager.subscription.fluent.models.RenamedSubscriptionIdInner; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequest; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipStatusResponse; +import com.azure.resourcemanager.subscription.models.CanceledSubscriptionId; +import com.azure.resourcemanager.subscription.models.EnabledSubscriptionId; +import com.azure.resourcemanager.subscription.models.RenamedSubscriptionId; +import com.azure.resourcemanager.subscription.models.SubscriptionName; import com.azure.resourcemanager.subscription.models.Subscriptions; public final class SubscriptionsImpl implements Subscriptions { @@ -29,43 +34,92 @@ public SubscriptionsImpl(SubscriptionsClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable listLocations(String subscriptionId) { - PagedIterable inner = this.serviceClient().listLocations(subscriptionId); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LocationImpl(inner1, this.manager())); + public Response cancelWithResponse(String subscriptionId, Context context) { + Response inner = this.serviceClient().cancelWithResponse(subscriptionId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new CanceledSubscriptionIdImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable listLocations(String subscriptionId, Context context) { - PagedIterable inner = this.serviceClient().listLocations(subscriptionId, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new LocationImpl(inner1, this.manager())); + public CanceledSubscriptionId cancel(String subscriptionId) { + CanceledSubscriptionIdInner inner = this.serviceClient().cancel(subscriptionId); + if (inner != null) { + return new CanceledSubscriptionIdImpl(inner, this.manager()); + } else { + return null; + } } - public Response getWithResponse(String subscriptionId, Context context) { - Response inner = this.serviceClient().getWithResponse(subscriptionId, context); + public Response renameWithResponse(String subscriptionId, SubscriptionName body, + Context context) { + Response inner + = this.serviceClient().renameWithResponse(subscriptionId, body, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new SubscriptionImpl(inner.getValue(), this.manager())); + new RenamedSubscriptionIdImpl(inner.getValue(), this.manager())); } else { return null; } } - public Subscription get(String subscriptionId) { - SubscriptionInner inner = this.serviceClient().get(subscriptionId); + public RenamedSubscriptionId rename(String subscriptionId, SubscriptionName body) { + RenamedSubscriptionIdInner inner = this.serviceClient().rename(subscriptionId, body); if (inner != null) { - return new SubscriptionImpl(inner, this.manager()); + return new RenamedSubscriptionIdImpl(inner, this.manager()); } else { return null; } } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SubscriptionImpl(inner1, this.manager())); + public Response enableWithResponse(String subscriptionId, Context context) { + Response inner = this.serviceClient().enableWithResponse(subscriptionId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new EnabledSubscriptionIdImpl(inner.getValue(), this.manager())); + } else { + return null; + } } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new SubscriptionImpl(inner1, this.manager())); + public EnabledSubscriptionId enable(String subscriptionId) { + EnabledSubscriptionIdInner inner = this.serviceClient().enable(subscriptionId); + if (inner != null) { + return new EnabledSubscriptionIdImpl(inner, this.manager()); + } else { + return null; + } + } + + public void acceptOwnership(String subscriptionId, AcceptOwnershipRequest body) { + this.serviceClient().acceptOwnership(subscriptionId, body); + } + + public void acceptOwnership(String subscriptionId, AcceptOwnershipRequest body, Context context) { + this.serviceClient().acceptOwnership(subscriptionId, body, context); + } + + public Response acceptOwnershipStatusWithResponse(String subscriptionId, + Context context) { + Response inner + = this.serviceClient().acceptOwnershipStatusWithResponse(subscriptionId, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new AcceptOwnershipStatusResponseImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public AcceptOwnershipStatusResponse acceptOwnershipStatus(String subscriptionId) { + AcceptOwnershipStatusResponseInner inner = this.serviceClient().acceptOwnershipStatus(subscriptionId); + if (inner != null) { + return new AcceptOwnershipStatusResponseImpl(inner, this.manager()); + } else { + return null; + } } private SubscriptionsClient serviceClient() { diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/TenantIdDescriptionImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/TenantIdDescriptionImpl.java deleted file mode 100644 index 8b7421c1c7f7..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/TenantIdDescriptionImpl.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.implementation; - -import com.azure.resourcemanager.subscription.fluent.models.TenantIdDescriptionInner; -import com.azure.resourcemanager.subscription.models.TenantIdDescription; - -public final class TenantIdDescriptionImpl implements TenantIdDescription { - private TenantIdDescriptionInner innerObject; - - private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; - - TenantIdDescriptionImpl(TenantIdDescriptionInner innerObject, - com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String tenantId() { - return this.innerModel().tenantId(); - } - - public String tenantCategory() { - return this.innerModel().tenantCategory(); - } - - public String country() { - return this.innerModel().country(); - } - - public String countryCode() { - return this.innerModel().countryCode(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String domains() { - return this.innerModel().domains(); - } - - public String defaultDomain() { - return this.innerModel().defaultDomain(); - } - - public String tenantType() { - return this.innerModel().tenantType(); - } - - public TenantIdDescriptionInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.subscription.SubscriptionManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/TenantsClientImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/TenantsClientImpl.java deleted file mode 100644 index da1a73c14765..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/TenantsClientImpl.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.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.subscription.fluent.TenantsClient; -import com.azure.resourcemanager.subscription.fluent.models.TenantIdDescriptionInner; -import com.azure.resourcemanager.subscription.models.TenantListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in TenantsClient. - */ -public final class TenantsClientImpl implements TenantsClient { - /** - * The proxy service used to perform REST calls. - */ - private final TenantsService service; - - /** - * The service client containing this operation class. - */ - private final SubscriptionClientImpl client; - - /** - * Initializes an instance of TenantsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TenantsClientImpl(SubscriptionClientImpl client) { - this.service = RestProxy.create(TenantsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for SubscriptionClientTenants to be used by the proxy service to perform - * REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "SubscriptionClientTe") - public interface TenantsService { - @Headers({ "Content-Type: application/json" }) - @Get("/tenants") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @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("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the tenants for your account. - * - * @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 tenants for your account along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2016-06-01"; - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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 the tenants for your account. - * - * @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 tenants for your account along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String apiVersion = "2016-06-01"; - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), apiVersion, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Gets the tenants for your account. - * - * @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 tenants for your account as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Gets the tenants for your account. - * - * @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 tenants for your account as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Gets the tenants for your account. - * - * @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 tenants for your account as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Gets the tenants for your account. - * - * @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 tenants for your account as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - 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 tenant Ids information along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(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.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. - * @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 tenant Ids information along with {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(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.listNext(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/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/TenantsImpl.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/TenantsImpl.java deleted file mode 100644 index 3969d2e1cb94..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/implementation/TenantsImpl.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.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.subscription.fluent.TenantsClient; -import com.azure.resourcemanager.subscription.fluent.models.TenantIdDescriptionInner; -import com.azure.resourcemanager.subscription.models.TenantIdDescription; -import com.azure.resourcemanager.subscription.models.Tenants; - -public final class TenantsImpl implements Tenants { - private static final ClientLogger LOGGER = new ClientLogger(TenantsImpl.class); - - private final TenantsClient innerClient; - - private final com.azure.resourcemanager.subscription.SubscriptionManager serviceManager; - - public TenantsImpl(TenantsClient innerClient, - com.azure.resourcemanager.subscription.SubscriptionManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TenantIdDescriptionImpl(inner1, this.manager())); - } - - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new TenantIdDescriptionImpl(inner1, this.manager())); - } - - private TenantsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.subscription.SubscriptionManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnership.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnership.java new file mode 100644 index 000000000000..5d4dc30933e1 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnership.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The accept ownership state of the resource. + */ +public final class AcceptOwnership extends ExpandableStringEnum { + /** + * Static value Pending for AcceptOwnership. + */ + public static final AcceptOwnership PENDING = fromString("Pending"); + + /** + * Static value Completed for AcceptOwnership. + */ + public static final AcceptOwnership COMPLETED = fromString("Completed"); + + /** + * Static value Expired for AcceptOwnership. + */ + public static final AcceptOwnership EXPIRED = fromString("Expired"); + + /** + * Creates a new instance of AcceptOwnership value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AcceptOwnership() { + } + + /** + * Creates or finds a AcceptOwnership from its string representation. + * + * @param name a name to look for. + * @return the corresponding AcceptOwnership. + */ + public static AcceptOwnership fromString(String name) { + return fromString(name, AcceptOwnership.class); + } + + /** + * Gets known AcceptOwnership values. + * + * @return known AcceptOwnership values. + */ + public static Collection values() { + return values(AcceptOwnership.class); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnershipRequest.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnershipRequest.java new file mode 100644 index 000000000000..7e4028eb97b8 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnershipRequest.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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; + +/** + * The parameters required to accept subscription ownership. + */ +@Fluent +public final class AcceptOwnershipRequest implements JsonSerializable { + /* + * Accept subscription ownership request properties. + */ + private AcceptOwnershipRequestProperties properties; + + /** + * Creates an instance of AcceptOwnershipRequest class. + */ + public AcceptOwnershipRequest() { + } + + /** + * Get the properties property: Accept subscription ownership request properties. + * + * @return the properties value. + */ + public AcceptOwnershipRequestProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Accept subscription ownership request properties. + * + * @param properties the properties value to set. + * @return the AcceptOwnershipRequest object itself. + */ + public AcceptOwnershipRequest withProperties(AcceptOwnershipRequestProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcceptOwnershipRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcceptOwnershipRequest 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 AcceptOwnershipRequest. + */ + public static AcceptOwnershipRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcceptOwnershipRequest deserializedAcceptOwnershipRequest = new AcceptOwnershipRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedAcceptOwnershipRequest.properties = AcceptOwnershipRequestProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAcceptOwnershipRequest; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnershipRequestProperties.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnershipRequestProperties.java new file mode 100644 index 000000000000..7eb267fcf5b1 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnershipRequestProperties.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +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.Map; + +/** + * Accept subscription ownership request properties. + */ +@Fluent +public final class AcceptOwnershipRequestProperties implements JsonSerializable { + /* + * The friendly name of the subscription. + */ + private String displayName; + + /* + * Management group Id for the subscription. + */ + private String managementGroupId; + + /* + * Tags for the subscription + */ + private Map tags; + + /** + * Creates an instance of AcceptOwnershipRequestProperties class. + */ + public AcceptOwnershipRequestProperties() { + } + + /** + * Get the displayName property: The friendly name of the subscription. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The friendly name of the subscription. + * + * @param displayName the displayName value to set. + * @return the AcceptOwnershipRequestProperties object itself. + */ + public AcceptOwnershipRequestProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the managementGroupId property: Management group Id for the subscription. + * + * @return the managementGroupId value. + */ + public String managementGroupId() { + return this.managementGroupId; + } + + /** + * Set the managementGroupId property: Management group Id for the subscription. + * + * @param managementGroupId the managementGroupId value to set. + * @return the AcceptOwnershipRequestProperties object itself. + */ + public AcceptOwnershipRequestProperties withManagementGroupId(String managementGroupId) { + this.managementGroupId = managementGroupId; + return this; + } + + /** + * Get the tags property: Tags for the subscription. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags for the subscription. + * + * @param tags the tags value to set. + * @return the AcceptOwnershipRequestProperties object itself. + */ + public AcceptOwnershipRequestProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (displayName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property displayName in model AcceptOwnershipRequestProperties")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AcceptOwnershipRequestProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("managementGroupId", this.managementGroupId); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AcceptOwnershipRequestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AcceptOwnershipRequestProperties 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 AcceptOwnershipRequestProperties. + */ + public static AcceptOwnershipRequestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AcceptOwnershipRequestProperties deserializedAcceptOwnershipRequestProperties + = new AcceptOwnershipRequestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("displayName".equals(fieldName)) { + deserializedAcceptOwnershipRequestProperties.displayName = reader.getString(); + } else if ("managementGroupId".equals(fieldName)) { + deserializedAcceptOwnershipRequestProperties.managementGroupId = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedAcceptOwnershipRequestProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedAcceptOwnershipRequestProperties; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnershipStatusResponse.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnershipStatusResponse.java new file mode 100644 index 000000000000..7b8aa9232a7b --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/AcceptOwnershipStatusResponse.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.models; + +import com.azure.resourcemanager.subscription.fluent.models.AcceptOwnershipStatusResponseInner; +import java.util.Map; + +/** + * An immutable client-side representation of AcceptOwnershipStatusResponse. + */ +public interface AcceptOwnershipStatusResponse { + /** + * Gets the subscriptionId property: Newly created subscription Id. + * + * @return the subscriptionId value. + */ + String subscriptionId(); + + /** + * Gets the acceptOwnershipState property: The accept ownership state of the resource. + * + * @return the acceptOwnershipState value. + */ + AcceptOwnership acceptOwnershipState(); + + /** + * Gets the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + Provisioning provisioningState(); + + /** + * Gets the billingOwner property: UPN of the billing owner. + * + * @return the billingOwner value. + */ + String billingOwner(); + + /** + * Gets the subscriptionTenantId property: Tenant Id of the subscription. + * + * @return the subscriptionTenantId value. + */ + String subscriptionTenantId(); + + /** + * Gets the displayName property: The display name of the subscription. + * + * @return the displayName value. + */ + String displayName(); + + /** + * Gets the tags property: Tags for the subscription. + * + * @return the tags value. + */ + Map tags(); + + /** + * Gets the inner com.azure.resourcemanager.subscription.fluent.models.AcceptOwnershipStatusResponseInner object. + * + * @return the inner object. + */ + AcceptOwnershipStatusResponseInner innerModel(); +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Alias.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Alias.java index 9766302f26c9..a33eb2a5bdfa 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Alias.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Alias.java @@ -14,21 +14,21 @@ public interface Alias { /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @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 subscription Information with the alias. */ - PutAliasResponse create(String aliasName, PutAliasRequest body); + SubscriptionAliasResponse create(String aliasName, PutAliasRequest body); /** * Create Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @param body The body parameter. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -36,38 +36,38 @@ public interface Alias { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return subscription Information with the alias. */ - PutAliasResponse create(String aliasName, PutAliasRequest body, Context context); + SubscriptionAliasResponse create(String aliasName, PutAliasRequest body, Context context); /** * Get Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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 alias Subscription along with {@link Response}. */ - Response getWithResponse(String aliasName, Context context); + Response getWithResponse(String aliasName, Context context); /** * Get Alias Subscription. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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 alias Subscription. */ - PutAliasResponse get(String aliasName); + SubscriptionAliasResponse get(String aliasName); /** * Delete Alias. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -79,8 +79,8 @@ public interface Alias { /** * Delete Alias. * - * @param aliasName Name for this subscription creation request also known as alias. Note that this is not the same - * as subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. + * @param aliasName AliasName is the name for the subscription creation request. Note that this is not the same as + * subscription name and this doesn’t have any other lifecycle need beyond the request for subscription creation. * @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. @@ -88,22 +88,22 @@ public interface Alias { void delete(String aliasName); /** - * Get Alias Subscription. + * List Alias 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 alias Subscription along with {@link Response}. + * @return the list of aliases along with {@link Response}. */ - Response listWithResponse(Context context); + Response listWithResponse(Context context); /** - * Get Alias Subscription. + * List Alias 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 alias Subscription. + * @return the list of aliases. */ - PutAliasListResult list(); + SubscriptionAliasListResult list(); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/BillingAccountPoliciesResponse.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/BillingAccountPoliciesResponse.java new file mode 100644 index 000000000000..4a3b7f8afc30 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/BillingAccountPoliciesResponse.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.subscription.fluent.models.BillingAccountPoliciesResponseInner; + +/** + * An immutable client-side representation of BillingAccountPoliciesResponse. + */ +public interface BillingAccountPoliciesResponse { + /** + * 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: Billing account policies response properties. + * + * @return the properties value. + */ + BillingAccountPoliciesResponseProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.subscription.fluent.models.BillingAccountPoliciesResponseInner object. + * + * @return the inner object. + */ + BillingAccountPoliciesResponseInner innerModel(); +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/BillingAccountPoliciesResponseProperties.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/BillingAccountPoliciesResponseProperties.java new file mode 100644 index 000000000000..1403e0d287c5 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/BillingAccountPoliciesResponseProperties.java @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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; + +/** + * Put billing account policies response properties. + */ +@Fluent +public final class BillingAccountPoliciesResponseProperties + implements JsonSerializable { + /* + * Service tenant for the billing account. + */ + private List serviceTenants; + + /* + * Determine if the transfers are allowed for the billing account + */ + private Boolean allowTransfers; + + /** + * Creates an instance of BillingAccountPoliciesResponseProperties class. + */ + public BillingAccountPoliciesResponseProperties() { + } + + /** + * Get the serviceTenants property: Service tenant for the billing account. + * + * @return the serviceTenants value. + */ + public List serviceTenants() { + return this.serviceTenants; + } + + /** + * Set the serviceTenants property: Service tenant for the billing account. + * + * @param serviceTenants the serviceTenants value to set. + * @return the BillingAccountPoliciesResponseProperties object itself. + */ + public BillingAccountPoliciesResponseProperties withServiceTenants(List serviceTenants) { + this.serviceTenants = serviceTenants; + return this; + } + + /** + * Get the allowTransfers property: Determine if the transfers are allowed for the billing account. + * + * @return the allowTransfers value. + */ + public Boolean allowTransfers() { + return this.allowTransfers; + } + + /** + * Set the allowTransfers property: Determine if the transfers are allowed for the billing account. + * + * @param allowTransfers the allowTransfers value to set. + * @return the BillingAccountPoliciesResponseProperties object itself. + */ + public BillingAccountPoliciesResponseProperties withAllowTransfers(Boolean allowTransfers) { + this.allowTransfers = allowTransfers; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (serviceTenants() != null) { + serviceTenants().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("serviceTenants", this.serviceTenants, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("allowTransfers", this.allowTransfers); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BillingAccountPoliciesResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BillingAccountPoliciesResponseProperties 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 BillingAccountPoliciesResponseProperties. + */ + public static BillingAccountPoliciesResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BillingAccountPoliciesResponseProperties deserializedBillingAccountPoliciesResponseProperties + = new BillingAccountPoliciesResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("serviceTenants".equals(fieldName)) { + List serviceTenants + = reader.readArray(reader1 -> ServiceTenantResponse.fromJson(reader1)); + deserializedBillingAccountPoliciesResponseProperties.serviceTenants = serviceTenants; + } else if ("allowTransfers".equals(fieldName)) { + deserializedBillingAccountPoliciesResponseProperties.allowTransfers + = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedBillingAccountPoliciesResponseProperties; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Tenants.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/BillingAccounts.java similarity index 57% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Tenants.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/BillingAccounts.java index ab8f9c0f8cf4..fa1fa399b04c 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Tenants.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/BillingAccounts.java @@ -4,30 +4,33 @@ package com.azure.resourcemanager.subscription.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 Tenants. + * Resource collection API of BillingAccounts. */ -public interface Tenants { +public interface BillingAccounts { /** - * Gets the tenants for your account. + * Get Billing Account Policy. * + * @param billingAccountId Billing Account 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 tenants for your account as paginated response with {@link PagedIterable}. + * @return billing Account Policy along with {@link Response}. */ - PagedIterable list(); + Response getPolicyWithResponse(String billingAccountId, Context context); /** - * Gets the tenants for your account. + * Get Billing Account Policy. * - * @param context The context to associate with this operation. + * @param billingAccountId Billing Account 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 tenants for your account as paginated response with {@link PagedIterable}. + * @return billing Account Policy. */ - PagedIterable list(Context context); + BillingAccountPoliciesResponse getPolicy(String billingAccountId); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/GetTenantPolicyListResponse.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/GetTenantPolicyListResponse.java new file mode 100644 index 000000000000..50b18a008bc0 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/GetTenantPolicyListResponse.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.fluent.models.GetTenantPolicyResponseInner; +import java.io.IOException; +import java.util.List; + +/** + * Tenant policy information list. + */ +@Immutable +public final class GetTenantPolicyListResponse implements JsonSerializable { + /* + * The list of tenant policies. + */ + private List value; + + /* + * The link (url) to the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of GetTenantPolicyListResponse class. + */ + public GetTenantPolicyListResponse() { + } + + /** + * Get the value property: The list of tenant policies. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link (url) to the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GetTenantPolicyListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GetTenantPolicyListResponse 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 GetTenantPolicyListResponse. + */ + public static GetTenantPolicyListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GetTenantPolicyListResponse deserializedGetTenantPolicyListResponse = new GetTenantPolicyListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GetTenantPolicyResponseInner.fromJson(reader1)); + deserializedGetTenantPolicyListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGetTenantPolicyListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGetTenantPolicyListResponse; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasResponse.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/GetTenantPolicyResponse.java similarity index 56% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasResponse.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/GetTenantPolicyResponse.java index 8185746513f5..b20b5f40b05f 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasResponse.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/GetTenantPolicyResponse.java @@ -4,12 +4,13 @@ package com.azure.resourcemanager.subscription.models; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasResponseInner; +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.subscription.fluent.models.GetTenantPolicyResponseInner; /** - * An immutable client-side representation of PutAliasResponse. + * An immutable client-side representation of GetTenantPolicyResponse. */ -public interface PutAliasResponse { +public interface GetTenantPolicyResponse { /** * Gets the id property: Fully qualified resource Id for the resource. * @@ -32,16 +33,23 @@ public interface PutAliasResponse { String type(); /** - * Gets the properties property: Put Alias response properties. + * Gets the properties property: Tenant policy properties. * * @return the properties value. */ - PutAliasResponseProperties properties(); + TenantPolicy properties(); /** - * Gets the inner com.azure.resourcemanager.subscription.fluent.models.PutAliasResponseInner object. + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.subscription.fluent.models.GetTenantPolicyResponseInner object. * * @return the inner object. */ - PutAliasResponseInner innerModel(); + GetTenantPolicyResponseInner innerModel(); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Location.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Location.java deleted file mode 100644 index e66e7e2062c5..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Location.java +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.models; - -import com.azure.resourcemanager.subscription.fluent.models.LocationInner; - -/** - * An immutable client-side representation of Location. - */ -public interface Location { - /** - * Gets the id property: The fully qualified ID of the location. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000/locations/westus. - * - * @return the id value. - */ - String id(); - - /** - * Gets the subscriptionId property: The subscription ID. - * - * @return the subscriptionId value. - */ - String subscriptionId(); - - /** - * Gets the name property: The location name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the displayName property: The display name of the location. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the latitude property: The latitude of the location. - * - * @return the latitude value. - */ - String latitude(); - - /** - * Gets the longitude property: The longitude of the location. - * - * @return the longitude value. - */ - String longitude(); - - /** - * Gets the inner com.azure.resourcemanager.subscription.fluent.models.LocationInner object. - * - * @return the inner object. - */ - LocationInner innerModel(); -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/LocationListResult.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/LocationListResult.java deleted file mode 100644 index e63064951fa7..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/LocationListResult.java +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.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 com.azure.resourcemanager.subscription.fluent.models.LocationInner; -import java.io.IOException; -import java.util.List; - -/** - * Location list operation response. - */ -@Fluent -public final class LocationListResult implements JsonSerializable { - /* - * An array of locations. - */ - private List value; - - /** - * Creates an instance of LocationListResult class. - */ - public LocationListResult() { - } - - /** - * Get the value property: An array of locations. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of locations. - * - * @param value the value value to set. - * @return the LocationListResult object itself. - */ - public LocationListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of LocationListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of LocationListResult 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 LocationListResult. - */ - public static LocationListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - LocationListResult deserializedLocationListResult = new LocationListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("value".equals(fieldName)) { - List value = reader.readArray(reader1 -> LocationInner.fromJson(reader1)); - deserializedLocationListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedLocationListResult; - }); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Operation.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Operation.java index 223a62b4955f..b8d4367a21b6 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Operation.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Operation.java @@ -4,121 +4,37 @@ package com.azure.resourcemanager.subscription.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 com.azure.resourcemanager.subscription.fluent.models.OperationInner; /** - * REST API operation. + * An immutable client-side representation of Operation. */ -@Fluent -public final class Operation implements JsonSerializable { - /* - * Operation name: {provider}/{resource}/{operation} - */ - private String name; - - /* - * The object that represents the operation. - */ - private OperationDisplay display; - - /** - * Creates an instance of Operation class. - */ - public Operation() { - } - +public interface Operation { /** - * Get the name property: Operation name: {provider}/{resource}/{operation}. + * Gets the name property: Operation name: {provider}/{resource}/{operation}. * * @return the name value. */ - public String name() { - return this.name; - } + String name(); /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. + * Gets the isDataAction property: Indicates whether the operation is a data action. * - * @param name the name value to set. - * @return the Operation object itself. + * @return the isDataAction value. */ - public Operation withName(String name) { - this.name = name; - return this; - } + Boolean isDataAction(); /** - * Get the display property: The object that represents the operation. + * Gets the display property: The object that represents the operation. * * @return the display value. */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: The object that represents the operation. - * - * @param display the display value to set. - * @return the Operation object itself. - */ - public Operation withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } + OperationDisplay display(); /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeJsonField("display", this.display); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of Operation from the JsonReader. + * Gets the inner com.azure.resourcemanager.subscription.fluent.models.OperationInner object. * - * @param jsonReader The JsonReader being read. - * @return An instance of Operation 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 Operation. + * @return the inner object. */ - public static Operation fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - Operation deserializedOperation = new Operation(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("name".equals(fieldName)) { - deserializedOperation.name = reader.getString(); - } else if ("display".equals(fieldName)) { - deserializedOperation.display = OperationDisplay.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperation; - }); - } + OperationInner innerModel(); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/OperationDisplay.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/OperationDisplay.java index 2447e8aedc86..063ccdd6cc78 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/OperationDisplay.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/OperationDisplay.java @@ -31,6 +31,11 @@ public final class OperationDisplay implements JsonSerializable { + /* + * List of operations. + */ + private List value; + + /* + * URL to get the next set of operation list results if there are any. + */ + private String nextLink; + + /** + * Creates an instance of OperationListResult class. + */ + public OperationListResult() { + } + /** - * Gets the value property: List of operations. + * Get the value property: List of operations. * * @return the value value. */ - List value(); + public List value() { + return this.value; + } + + /** + * Set the value property: List of operations. + * + * @param value the value value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withValue(List value) { + this.value = value; + return this; + } /** - * Gets the nextLink property: URL to get the next set of operation list results if there are any. + * Get the nextLink property: URL to get the next set of operation list results if there are any. * * @return the nextLink value. */ - String nextLink(); + public String nextLink() { + return this.nextLink; + } + + /** + * Set the nextLink property: URL to get the next set of operation list results if there are any. + * + * @param nextLink the nextLink value to set. + * @return the OperationListResult object itself. + */ + public OperationListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@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(); + } /** - * Gets the inner com.azure.resourcemanager.subscription.fluent.models.OperationListResultInner object. + * Reads an instance of OperationListResult from the JsonReader. * - * @return the inner object. + * @param jsonReader The JsonReader being read. + * @return An instance of OperationListResult 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 OperationListResult. */ - OperationListResultInner innerModel(); + public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationListResult deserializedOperationListResult = new OperationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value = reader.readArray(reader1 -> OperationInner.fromJson(reader1)); + deserializedOperationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedOperationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationListResult; + }); + } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Operations.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Operations.java index 53fc8bdb085e..f8ff69f92ef4 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Operations.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Operations.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.subscription.models; -import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; /** @@ -14,20 +14,20 @@ public interface Operations { /** * Lists all of the available Microsoft.Subscription API operations. * - * @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 result of the request to list operations along with {@link Response}. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ - Response listWithResponse(Context context); + PagedIterable list(); /** * Lists all of the available Microsoft.Subscription API operations. * + * @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 result of the request to list operations. + * @return result of the request to list operations as paginated response with {@link PagedIterable}. */ - OperationListResult list(); + PagedIterable list(Context context); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Provisioning.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Provisioning.java new file mode 100644 index 000000000000..5b5cfd378de5 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Provisioning.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The provisioning state of the resource. + */ +public final class Provisioning extends ExpandableStringEnum { + /** + * Static value Pending for Provisioning. + */ + public static final Provisioning PENDING = fromString("Pending"); + + /** + * Static value Accepted for Provisioning. + */ + public static final Provisioning ACCEPTED = fromString("Accepted"); + + /** + * Static value Succeeded for Provisioning. + */ + public static final Provisioning SUCCEEDED = fromString("Succeeded"); + + /** + * Creates a new instance of Provisioning value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Provisioning() { + } + + /** + * Creates or finds a Provisioning from its string representation. + * + * @param name a name to look for. + * @return the corresponding Provisioning. + */ + public static Provisioning fromString(String name) { + return fromString(name, Provisioning.class); + } + + /** + * Gets known Provisioning values. + * + * @return known Provisioning values. + */ + public static Collection values() { + return values(Provisioning.class); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequest.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequest.java index 6eee633eec6c..21df61a86989 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequest.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequest.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.subscription.models; import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -54,16 +53,11 @@ public PutAliasRequest withProperties(PutAliasRequestProperties properties) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property properties in model PutAliasRequest")); - } else { + if (properties() != null) { properties().validate(); } } - private static final ClientLogger LOGGER = new ClientLogger(PutAliasRequest.class); - /** * {@inheritDoc} */ @@ -80,7 +74,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of PutAliasRequest 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 PutAliasRequest. */ public static PutAliasRequest fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequestAdditionalProperties.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequestAdditionalProperties.java new file mode 100644 index 000000000000..9d035ad0c188 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequestAdditionalProperties.java @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.Map; + +/** + * Put subscription additional properties. + */ +@Fluent +public final class PutAliasRequestAdditionalProperties + implements JsonSerializable { + /* + * Management group Id for the subscription. + */ + private String managementGroupId; + + /* + * Tenant Id of the subscription + */ + private String subscriptionTenantId; + + /* + * Owner Id of the subscription + */ + private String subscriptionOwnerId; + + /* + * Tags for the subscription + */ + private Map tags; + + /** + * Creates an instance of PutAliasRequestAdditionalProperties class. + */ + public PutAliasRequestAdditionalProperties() { + } + + /** + * Get the managementGroupId property: Management group Id for the subscription. + * + * @return the managementGroupId value. + */ + public String managementGroupId() { + return this.managementGroupId; + } + + /** + * Set the managementGroupId property: Management group Id for the subscription. + * + * @param managementGroupId the managementGroupId value to set. + * @return the PutAliasRequestAdditionalProperties object itself. + */ + public PutAliasRequestAdditionalProperties withManagementGroupId(String managementGroupId) { + this.managementGroupId = managementGroupId; + return this; + } + + /** + * Get the subscriptionTenantId property: Tenant Id of the subscription. + * + * @return the subscriptionTenantId value. + */ + public String subscriptionTenantId() { + return this.subscriptionTenantId; + } + + /** + * Set the subscriptionTenantId property: Tenant Id of the subscription. + * + * @param subscriptionTenantId the subscriptionTenantId value to set. + * @return the PutAliasRequestAdditionalProperties object itself. + */ + public PutAliasRequestAdditionalProperties withSubscriptionTenantId(String subscriptionTenantId) { + this.subscriptionTenantId = subscriptionTenantId; + return this; + } + + /** + * Get the subscriptionOwnerId property: Owner Id of the subscription. + * + * @return the subscriptionOwnerId value. + */ + public String subscriptionOwnerId() { + return this.subscriptionOwnerId; + } + + /** + * Set the subscriptionOwnerId property: Owner Id of the subscription. + * + * @param subscriptionOwnerId the subscriptionOwnerId value to set. + * @return the PutAliasRequestAdditionalProperties object itself. + */ + public PutAliasRequestAdditionalProperties withSubscriptionOwnerId(String subscriptionOwnerId) { + this.subscriptionOwnerId = subscriptionOwnerId; + return this; + } + + /** + * Get the tags property: Tags for the subscription. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags for the subscription. + * + * @param tags the tags value to set. + * @return the PutAliasRequestAdditionalProperties object itself. + */ + public PutAliasRequestAdditionalProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("managementGroupId", this.managementGroupId); + jsonWriter.writeStringField("subscriptionTenantId", this.subscriptionTenantId); + jsonWriter.writeStringField("subscriptionOwnerId", this.subscriptionOwnerId); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PutAliasRequestAdditionalProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PutAliasRequestAdditionalProperties 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 PutAliasRequestAdditionalProperties. + */ + public static PutAliasRequestAdditionalProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PutAliasRequestAdditionalProperties deserializedPutAliasRequestAdditionalProperties + = new PutAliasRequestAdditionalProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("managementGroupId".equals(fieldName)) { + deserializedPutAliasRequestAdditionalProperties.managementGroupId = reader.getString(); + } else if ("subscriptionTenantId".equals(fieldName)) { + deserializedPutAliasRequestAdditionalProperties.subscriptionTenantId = reader.getString(); + } else if ("subscriptionOwnerId".equals(fieldName)) { + deserializedPutAliasRequestAdditionalProperties.subscriptionOwnerId = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPutAliasRequestAdditionalProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedPutAliasRequestAdditionalProperties; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequestProperties.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequestProperties.java index efa30e68c2b0..195f8ca7edc1 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequestProperties.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasRequestProperties.java @@ -27,7 +27,11 @@ public final class PutAliasRequestProperties implements JsonSerializable { - /* - * Newly created subscription Id. - */ - private String subscriptionId; - - /* - * The provisioning state of the resource. - */ - private ProvisioningState provisioningState; - - /** - * Creates an instance of PutAliasResponseProperties class. - */ - public PutAliasResponseProperties() { - } - - /** - * Get the subscriptionId property: Newly created subscription Id. - * - * @return the subscriptionId value. - */ - public String subscriptionId() { - return this.subscriptionId; - } - - /** - * Get the provisioningState property: The provisioning state of the resource. - * - * @return the provisioningState value. - */ - public ProvisioningState provisioningState() { - return this.provisioningState; - } - - /** - * Set the provisioningState property: The provisioning state of the resource. - * - * @param provisioningState the provisioningState value to set. - * @return the PutAliasResponseProperties object itself. - */ - public PutAliasResponseProperties withProvisioningState(ProvisioningState provisioningState) { - this.provisioningState = provisioningState; - return this; - } - - /** - * 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(); - jsonWriter.writeStringField("provisioningState", - this.provisioningState == null ? null : this.provisioningState.toString()); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of PutAliasResponseProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of PutAliasResponseProperties 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 PutAliasResponseProperties. - */ - public static PutAliasResponseProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - PutAliasResponseProperties deserializedPutAliasResponseProperties = new PutAliasResponseProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("subscriptionId".equals(fieldName)) { - deserializedPutAliasResponseProperties.subscriptionId = reader.getString(); - } else if ("provisioningState".equals(fieldName)) { - deserializedPutAliasResponseProperties.provisioningState - = ProvisioningState.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedPutAliasResponseProperties; - }); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutTenantPolicyRequestProperties.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutTenantPolicyRequestProperties.java new file mode 100644 index 000000000000..b3cf29353807 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutTenantPolicyRequestProperties.java @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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; +import java.util.Objects; +import java.util.UUID; + +/** + * Put tenant policy request properties. + */ +@Fluent +public final class PutTenantPolicyRequestProperties implements JsonSerializable { + /* + * Blocks the leaving of subscriptions from user's tenant. + */ + private Boolean blockSubscriptionsLeavingTenant; + + /* + * Blocks the entering of subscriptions into user's tenant. + */ + private Boolean blockSubscriptionsIntoTenant; + + /* + * List of user objectIds that are exempted from the set subscription tenant policies for the user's tenant. + */ + private List exemptedPrincipals; + + /** + * Creates an instance of PutTenantPolicyRequestProperties class. + */ + public PutTenantPolicyRequestProperties() { + } + + /** + * Get the blockSubscriptionsLeavingTenant property: Blocks the leaving of subscriptions from user's tenant. + * + * @return the blockSubscriptionsLeavingTenant value. + */ + public Boolean blockSubscriptionsLeavingTenant() { + return this.blockSubscriptionsLeavingTenant; + } + + /** + * Set the blockSubscriptionsLeavingTenant property: Blocks the leaving of subscriptions from user's tenant. + * + * @param blockSubscriptionsLeavingTenant the blockSubscriptionsLeavingTenant value to set. + * @return the PutTenantPolicyRequestProperties object itself. + */ + public PutTenantPolicyRequestProperties + withBlockSubscriptionsLeavingTenant(Boolean blockSubscriptionsLeavingTenant) { + this.blockSubscriptionsLeavingTenant = blockSubscriptionsLeavingTenant; + return this; + } + + /** + * Get the blockSubscriptionsIntoTenant property: Blocks the entering of subscriptions into user's tenant. + * + * @return the blockSubscriptionsIntoTenant value. + */ + public Boolean blockSubscriptionsIntoTenant() { + return this.blockSubscriptionsIntoTenant; + } + + /** + * Set the blockSubscriptionsIntoTenant property: Blocks the entering of subscriptions into user's tenant. + * + * @param blockSubscriptionsIntoTenant the blockSubscriptionsIntoTenant value to set. + * @return the PutTenantPolicyRequestProperties object itself. + */ + public PutTenantPolicyRequestProperties withBlockSubscriptionsIntoTenant(Boolean blockSubscriptionsIntoTenant) { + this.blockSubscriptionsIntoTenant = blockSubscriptionsIntoTenant; + return this; + } + + /** + * Get the exemptedPrincipals property: List of user objectIds that are exempted from the set subscription tenant + * policies for the user's tenant. + * + * @return the exemptedPrincipals value. + */ + public List exemptedPrincipals() { + return this.exemptedPrincipals; + } + + /** + * Set the exemptedPrincipals property: List of user objectIds that are exempted from the set subscription tenant + * policies for the user's tenant. + * + * @param exemptedPrincipals the exemptedPrincipals value to set. + * @return the PutTenantPolicyRequestProperties object itself. + */ + public PutTenantPolicyRequestProperties withExemptedPrincipals(List exemptedPrincipals) { + this.exemptedPrincipals = exemptedPrincipals; + return this; + } + + /** + * 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(); + jsonWriter.writeBooleanField("blockSubscriptionsLeavingTenant", this.blockSubscriptionsLeavingTenant); + jsonWriter.writeBooleanField("blockSubscriptionsIntoTenant", this.blockSubscriptionsIntoTenant); + jsonWriter.writeArrayField("exemptedPrincipals", this.exemptedPrincipals, + (writer, element) -> writer.writeString(Objects.toString(element, null))); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PutTenantPolicyRequestProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PutTenantPolicyRequestProperties 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 PutTenantPolicyRequestProperties. + */ + public static PutTenantPolicyRequestProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PutTenantPolicyRequestProperties deserializedPutTenantPolicyRequestProperties + = new PutTenantPolicyRequestProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("blockSubscriptionsLeavingTenant".equals(fieldName)) { + deserializedPutTenantPolicyRequestProperties.blockSubscriptionsLeavingTenant + = reader.getNullable(JsonReader::getBoolean); + } else if ("blockSubscriptionsIntoTenant".equals(fieldName)) { + deserializedPutTenantPolicyRequestProperties.blockSubscriptionsIntoTenant + = reader.getNullable(JsonReader::getBoolean); + } else if ("exemptedPrincipals".equals(fieldName)) { + List exemptedPrincipals = reader.readArray( + reader1 -> reader1.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()))); + deserializedPutTenantPolicyRequestProperties.exemptedPrincipals = exemptedPrincipals; + } else { + reader.skipChildren(); + } + } + + return deserializedPutTenantPolicyRequestProperties; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/ServiceTenantResponse.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/ServiceTenantResponse.java new file mode 100644 index 000000000000..9fb123969f1e --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/ServiceTenantResponse.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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; + +/** + * Billing account service tenant. + */ +@Fluent +public final class ServiceTenantResponse implements JsonSerializable { + /* + * Service tenant id. + */ + private String tenantId; + + /* + * Service tenant name. + */ + private String tenantName; + + /** + * Creates an instance of ServiceTenantResponse class. + */ + public ServiceTenantResponse() { + } + + /** + * Get the tenantId property: Service tenant id. + * + * @return the tenantId value. + */ + public String tenantId() { + return this.tenantId; + } + + /** + * Set the tenantId property: Service tenant id. + * + * @param tenantId the tenantId value to set. + * @return the ServiceTenantResponse object itself. + */ + public ServiceTenantResponse withTenantId(String tenantId) { + this.tenantId = tenantId; + return this; + } + + /** + * Get the tenantName property: Service tenant name. + * + * @return the tenantName value. + */ + public String tenantName() { + return this.tenantName; + } + + /** + * Set the tenantName property: Service tenant name. + * + * @param tenantName the tenantName value to set. + * @return the ServiceTenantResponse object itself. + */ + public ServiceTenantResponse withTenantName(String tenantName) { + this.tenantName = tenantName; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("tenantId", this.tenantId); + jsonWriter.writeStringField("tenantName", this.tenantName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ServiceTenantResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ServiceTenantResponse 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 ServiceTenantResponse. + */ + public static ServiceTenantResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ServiceTenantResponse deserializedServiceTenantResponse = new ServiceTenantResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tenantId".equals(fieldName)) { + deserializedServiceTenantResponse.tenantId = reader.getString(); + } else if ("tenantName".equals(fieldName)) { + deserializedServiceTenantResponse.tenantName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedServiceTenantResponse; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SpendingLimit.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SpendingLimit.java deleted file mode 100644 index b2d6179e8487..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SpendingLimit.java +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.models; - -/** - * The subscription spending limit. - */ -public enum SpendingLimit { - /** - * Enum value On. - */ - ON("On"), - - /** - * Enum value Off. - */ - OFF("Off"), - - /** - * Enum value CurrentPeriodOff. - */ - CURRENT_PERIOD_OFF("CurrentPeriodOff"); - - /** - * The actual serialized value for a SpendingLimit instance. - */ - private final String value; - - SpendingLimit(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SpendingLimit instance. - * - * @param value the serialized value to parse. - * @return the parsed SpendingLimit object, or null if unable to parse. - */ - public static SpendingLimit fromString(String value) { - if (value == null) { - return null; - } - SpendingLimit[] items = SpendingLimit.values(); - for (SpendingLimit item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Subscription.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Subscription.java deleted file mode 100644 index 48f20f7a286c..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Subscription.java +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.models; - -import com.azure.resourcemanager.subscription.fluent.models.SubscriptionInner; -import java.util.Map; - -/** - * An immutable client-side representation of Subscription. - */ -public interface Subscription { - /** - * Gets the id property: The fully qualified ID for the subscription. For example, - * /subscriptions/00000000-0000-0000-0000-000000000000. - * - * @return the id value. - */ - String id(); - - /** - * Gets the subscriptionId property: The subscription ID. - * - * @return the subscriptionId value. - */ - String subscriptionId(); - - /** - * Gets the displayName property: The subscription display name. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the state property: The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and - * Deleted. - * - * @return the state value. - */ - SubscriptionState state(); - - /** - * Gets the tenantId property: The tenant ID. For example, 00000000-0000-0000-0000-000000000000. - * - * @return the tenantId value. - */ - String tenantId(); - - /** - * Gets the tags property: Tags for the subscription. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the subscriptionPolicies property: The subscription policies. - * - * @return the subscriptionPolicies value. - */ - SubscriptionPolicies subscriptionPolicies(); - - /** - * Gets the authorizationSource property: The authorization source of the request. Valid values are one or more - * combinations of Legacy, RoleBased, Bypassed, Direct and Management. For example, 'Legacy, RoleBased'. - * - * @return the authorizationSource value. - */ - String authorizationSource(); - - /** - * Gets the inner com.azure.resourcemanager.subscription.fluent.models.SubscriptionInner object. - * - * @return the inner object. - */ - SubscriptionInner innerModel(); -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasListResult.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionAliasListResult.java similarity index 63% rename from sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasListResult.java rename to sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionAliasListResult.java index c4bb351e6bd3..12e89717d1f8 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/PutAliasListResult.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionAliasListResult.java @@ -4,19 +4,19 @@ package com.azure.resourcemanager.subscription.models; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasListResultInner; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasListResultInner; import java.util.List; /** - * An immutable client-side representation of PutAliasListResult. + * An immutable client-side representation of SubscriptionAliasListResult. */ -public interface PutAliasListResult { +public interface SubscriptionAliasListResult { /** * Gets the value property: The list of alias. * * @return the value value. */ - List value(); + List value(); /** * Gets the nextLink property: The link (url) to the next page of results. @@ -26,9 +26,9 @@ public interface PutAliasListResult { String nextLink(); /** - * Gets the inner com.azure.resourcemanager.subscription.fluent.models.PutAliasListResultInner object. + * Gets the inner com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasListResultInner object. * * @return the inner object. */ - PutAliasListResultInner innerModel(); + SubscriptionAliasListResultInner innerModel(); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionAliasResponse.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionAliasResponse.java new file mode 100644 index 000000000000..df6f6d9547a8 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionAliasResponse.java @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.models; + +import com.azure.core.management.SystemData; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasResponseInner; + +/** + * An immutable client-side representation of SubscriptionAliasResponse. + */ +public interface SubscriptionAliasResponse { + /** + * 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: Subscription Alias response properties. + * + * @return the properties value. + */ + SubscriptionAliasResponseProperties properties(); + + /** + * Gets the systemData property: Metadata pertaining to creation and last modification of the resource. + * + * @return the systemData value. + */ + SystemData systemData(); + + /** + * Gets the inner com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasResponseInner object. + * + * @return the inner object. + */ + SubscriptionAliasResponseInner innerModel(); +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionAliasResponseProperties.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionAliasResponseProperties.java new file mode 100644 index 000000000000..9bc24b32b3d3 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionAliasResponseProperties.java @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.Map; + +/** + * Put subscription creation result properties. + */ +@Fluent +public final class SubscriptionAliasResponseProperties + implements JsonSerializable { + /* + * Newly created subscription Id. + */ + private String subscriptionId; + + /* + * The display name of the subscription. + */ + private String displayName; + + /* + * The provisioning state of the resource. + */ + private ProvisioningState provisioningState; + + /* + * Url to accept ownership of the subscription. + */ + private String acceptOwnershipUrl; + + /* + * The accept ownership state of the resource. + */ + private AcceptOwnership acceptOwnershipState; + + /* + * Billing scope of the subscription. + * For CustomerLed and FieldLed - + * /billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName} + * For PartnerLed - /billingAccounts/{billingAccountName}/customers/{customerName} + * For Legacy EA - /billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName} + */ + private String billingScope; + + /* + * The workload type of the subscription. It can be either Production or DevTest. + */ + private Workload workload; + + /* + * Reseller Id + */ + private String resellerId; + + /* + * Owner Id of the subscription + */ + private String subscriptionOwnerId; + + /* + * The Management Group Id. + */ + private String managementGroupId; + + /* + * Created Time + */ + private String createdTime; + + /* + * Tags for the subscription + */ + private Map tags; + + /** + * Creates an instance of SubscriptionAliasResponseProperties class. + */ + public SubscriptionAliasResponseProperties() { + } + + /** + * Get the subscriptionId property: Newly created subscription Id. + * + * @return the subscriptionId value. + */ + public String subscriptionId() { + return this.subscriptionId; + } + + /** + * Get the displayName property: The display name of the subscription. + * + * @return the displayName value. + */ + public String displayName() { + return this.displayName; + } + + /** + * Set the displayName property: The display name of the subscription. + * + * @param displayName the displayName value to set. + * @return the SubscriptionAliasResponseProperties object itself. + */ + public SubscriptionAliasResponseProperties withDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: The provisioning state of the resource. + * + * @param provisioningState the provisioningState value to set. + * @return the SubscriptionAliasResponseProperties object itself. + */ + public SubscriptionAliasResponseProperties withProvisioningState(ProvisioningState provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the acceptOwnershipUrl property: Url to accept ownership of the subscription. + * + * @return the acceptOwnershipUrl value. + */ + public String acceptOwnershipUrl() { + return this.acceptOwnershipUrl; + } + + /** + * Get the acceptOwnershipState property: The accept ownership state of the resource. + * + * @return the acceptOwnershipState value. + */ + public AcceptOwnership acceptOwnershipState() { + return this.acceptOwnershipState; + } + + /** + * Get the billingScope property: Billing scope of the subscription. + * For CustomerLed and FieldLed - + * /billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName} + * For PartnerLed - /billingAccounts/{billingAccountName}/customers/{customerName} + * For Legacy EA - /billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}. + * + * @return the billingScope value. + */ + public String billingScope() { + return this.billingScope; + } + + /** + * Set the billingScope property: Billing scope of the subscription. + * For CustomerLed and FieldLed - + * /billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName} + * For PartnerLed - /billingAccounts/{billingAccountName}/customers/{customerName} + * For Legacy EA - /billingAccounts/{billingAccountName}/enrollmentAccounts/{enrollmentAccountName}. + * + * @param billingScope the billingScope value to set. + * @return the SubscriptionAliasResponseProperties object itself. + */ + public SubscriptionAliasResponseProperties withBillingScope(String billingScope) { + this.billingScope = billingScope; + return this; + } + + /** + * Get the workload property: The workload type of the subscription. It can be either Production or DevTest. + * + * @return the workload value. + */ + public Workload workload() { + return this.workload; + } + + /** + * Set the workload property: The workload type of the subscription. It can be either Production or DevTest. + * + * @param workload the workload value to set. + * @return the SubscriptionAliasResponseProperties object itself. + */ + public SubscriptionAliasResponseProperties withWorkload(Workload workload) { + this.workload = workload; + return this; + } + + /** + * Get the resellerId property: Reseller Id. + * + * @return the resellerId value. + */ + public String resellerId() { + return this.resellerId; + } + + /** + * Set the resellerId property: Reseller Id. + * + * @param resellerId the resellerId value to set. + * @return the SubscriptionAliasResponseProperties object itself. + */ + public SubscriptionAliasResponseProperties withResellerId(String resellerId) { + this.resellerId = resellerId; + return this; + } + + /** + * Get the subscriptionOwnerId property: Owner Id of the subscription. + * + * @return the subscriptionOwnerId value. + */ + public String subscriptionOwnerId() { + return this.subscriptionOwnerId; + } + + /** + * Set the subscriptionOwnerId property: Owner Id of the subscription. + * + * @param subscriptionOwnerId the subscriptionOwnerId value to set. + * @return the SubscriptionAliasResponseProperties object itself. + */ + public SubscriptionAliasResponseProperties withSubscriptionOwnerId(String subscriptionOwnerId) { + this.subscriptionOwnerId = subscriptionOwnerId; + return this; + } + + /** + * Get the managementGroupId property: The Management Group Id. + * + * @return the managementGroupId value. + */ + public String managementGroupId() { + return this.managementGroupId; + } + + /** + * Set the managementGroupId property: The Management Group Id. + * + * @param managementGroupId the managementGroupId value to set. + * @return the SubscriptionAliasResponseProperties object itself. + */ + public SubscriptionAliasResponseProperties withManagementGroupId(String managementGroupId) { + this.managementGroupId = managementGroupId; + return this; + } + + /** + * Get the createdTime property: Created Time. + * + * @return the createdTime value. + */ + public String createdTime() { + return this.createdTime; + } + + /** + * Set the createdTime property: Created Time. + * + * @param createdTime the createdTime value to set. + * @return the SubscriptionAliasResponseProperties object itself. + */ + public SubscriptionAliasResponseProperties withCreatedTime(String createdTime) { + this.createdTime = createdTime; + return this; + } + + /** + * Get the tags property: Tags for the subscription. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags for the subscription. + * + * @param tags the tags value to set. + * @return the SubscriptionAliasResponseProperties object itself. + */ + public SubscriptionAliasResponseProperties withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * 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(); + jsonWriter.writeStringField("displayName", this.displayName); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + jsonWriter.writeStringField("billingScope", this.billingScope); + jsonWriter.writeStringField("workload", this.workload == null ? null : this.workload.toString()); + jsonWriter.writeStringField("resellerId", this.resellerId); + jsonWriter.writeStringField("subscriptionOwnerId", this.subscriptionOwnerId); + jsonWriter.writeStringField("managementGroupId", this.managementGroupId); + jsonWriter.writeStringField("createdTime", this.createdTime); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of SubscriptionAliasResponseProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of SubscriptionAliasResponseProperties 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 SubscriptionAliasResponseProperties. + */ + public static SubscriptionAliasResponseProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + SubscriptionAliasResponseProperties deserializedSubscriptionAliasResponseProperties + = new SubscriptionAliasResponseProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("subscriptionId".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.subscriptionId = reader.getString(); + } else if ("displayName".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.displayName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("acceptOwnershipUrl".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.acceptOwnershipUrl = reader.getString(); + } else if ("acceptOwnershipState".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.acceptOwnershipState + = AcceptOwnership.fromString(reader.getString()); + } else if ("billingScope".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.billingScope = reader.getString(); + } else if ("workload".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.workload = Workload.fromString(reader.getString()); + } else if ("resellerId".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.resellerId = reader.getString(); + } else if ("subscriptionOwnerId".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.subscriptionOwnerId = reader.getString(); + } else if ("managementGroupId".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.managementGroupId = reader.getString(); + } else if ("createdTime".equals(fieldName)) { + deserializedSubscriptionAliasResponseProperties.createdTime = reader.getString(); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSubscriptionAliasResponseProperties.tags = tags; + } else { + reader.skipChildren(); + } + } + + return deserializedSubscriptionAliasResponseProperties; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionCreationResult.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionCreationResult.java new file mode 100644 index 000000000000..30b0b82dbb3f --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionCreationResult.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.models; + +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionCreationResultInner; + +/** + * An immutable client-side representation of SubscriptionCreationResult. + */ +public interface SubscriptionCreationResult { + /** + * Gets the subscriptionLink property: The link to the new subscription. Use this link to check the status of + * subscription creation operation. + * + * @return the subscriptionLink value. + */ + String subscriptionLink(); + + /** + * Gets the inner com.azure.resourcemanager.subscription.fluent.models.SubscriptionCreationResultInner object. + * + * @return the inner object. + */ + SubscriptionCreationResultInner innerModel(); +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperations.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperations.java index 58bc3642ce48..5b73fe557b6a 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperations.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperations.java @@ -12,73 +12,27 @@ */ public interface SubscriptionOperations { /** - * The operation to cancel a subscription. + * Get the status of the pending Microsoft.Subscription API operations. * - * @param subscriptionId Subscription Id. + * @param operationId The operation ID, which can be found from the Location field in the generate recommendation + * response header. * @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 ID of the canceled subscription along with {@link Response}. + * @return the status of the pending Microsoft.Subscription API operations. */ - Response cancelWithResponse(String subscriptionId, Context context); + Response getWithResponse(String operationId, Context context); /** - * The operation to cancel a subscription. + * Get the status of the pending Microsoft.Subscription API operations. * - * @param subscriptionId Subscription Id. + * @param operationId The operation ID, which can be found from the Location field in the generate recommendation + * response header. * @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 ID of the canceled subscription. + * @return the status of the pending Microsoft.Subscription API operations. */ - CanceledSubscriptionId cancel(String subscriptionId); - - /** - * The operation to rename a subscription. - * - * @param subscriptionId Subscription Id. - * @param body Subscription 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 ID of the subscriptions that is being renamed along with {@link Response}. - */ - Response renameWithResponse(String subscriptionId, SubscriptionName body, Context context); - - /** - * The operation to rename a subscription. - * - * @param subscriptionId Subscription Id. - * @param body Subscription 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 ID of the subscriptions that is being renamed. - */ - RenamedSubscriptionId rename(String subscriptionId, SubscriptionName body); - - /** - * The operation to enable a subscription. - * - * @param subscriptionId Subscription 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 ID of the subscriptions that is being enabled along with {@link Response}. - */ - Response enableWithResponse(String subscriptionId, Context context); - - /** - * The operation to enable a subscription. - * - * @param subscriptionId Subscription 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 ID of the subscriptions that is being enabled. - */ - EnabledSubscriptionId enable(String subscriptionId); + SubscriptionCreationResult get(String operationId); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperationsGetHeaders.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperationsGetHeaders.java new file mode 100644 index 000000000000..8b656f0c1c54 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperationsGetHeaders.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; + +/** + * The SubscriptionOperationsGetHeaders model. + */ +@Fluent +public final class SubscriptionOperationsGetHeaders { + /* + * The Retry-After property. + */ + private Long retryAfter; + + /* + * The Location property. + */ + private String location; + + // HttpHeaders containing the raw property values. + /** + * Creates an instance of SubscriptionOperationsGetHeaders class. + * + * @param rawHeaders The raw HttpHeaders that will be used to create the property values. + */ + public SubscriptionOperationsGetHeaders(HttpHeaders rawHeaders) { + String retryAfter = rawHeaders.getValue(HttpHeaderName.RETRY_AFTER); + if (retryAfter != null) { + this.retryAfter = Long.parseLong(retryAfter); + } else { + this.retryAfter = null; + } + this.location = rawHeaders.getValue(HttpHeaderName.LOCATION); + } + + /** + * Get the retryAfter property: The Retry-After property. + * + * @return the retryAfter value. + */ + public Long retryAfter() { + return this.retryAfter; + } + + /** + * Set the retryAfter property: The Retry-After property. + * + * @param retryAfter the retryAfter value to set. + * @return the SubscriptionOperationsGetHeaders object itself. + */ + public SubscriptionOperationsGetHeaders withRetryAfter(Long retryAfter) { + this.retryAfter = retryAfter; + return this; + } + + /** + * Get the location property: The Location property. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The Location property. + * + * @param location the location value to set. + * @return the SubscriptionOperationsGetHeaders object itself. + */ + public SubscriptionOperationsGetHeaders withLocation(String location) { + this.location = location; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperationsGetResponse.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperationsGetResponse.java new file mode 100644 index 000000000000..bb42c939c57c --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionOperationsGetResponse.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.models; + +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionCreationResultInner; + +/** + * Contains all response data for the get operation. + */ +public final class SubscriptionOperationsGetResponse + extends ResponseBase { + /** + * Creates an instance of SubscriptionOperationsGetResponse. + * + * @param request the request which resulted in this SubscriptionOperationsGetResponse. + * @param statusCode the status code of the HTTP response. + * @param rawHeaders the raw headers of the HTTP response. + * @param value the deserialized value of the HTTP response. + * @param headers the deserialized headers of the HTTP response. + */ + public SubscriptionOperationsGetResponse(HttpRequest request, int statusCode, HttpHeaders rawHeaders, + SubscriptionCreationResultInner value, SubscriptionOperationsGetHeaders headers) { + super(request, statusCode, rawHeaders, value, headers); + } + + /** + * Gets the deserialized response body. + * + * @return the deserialized response body. + */ + @Override + public SubscriptionCreationResultInner getValue() { + return super.getValue(); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionPolicies.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionPolicies.java index 776bcf7ee352..011b7b41bb60 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionPolicies.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionPolicies.java @@ -4,113 +4,75 @@ package com.azure.resourcemanager.subscription.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; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; /** - * Subscription policies. + * Resource collection API of SubscriptionPolicies. */ -@Immutable -public final class SubscriptionPolicies implements JsonSerializable { - /* - * The subscription location placement ID. The ID indicates which regions are visible for a subscription. For - * example, a subscription with a location placement Id of Public_2014-09-01 has access to Azure public regions. - */ - private String locationPlacementId; - - /* - * The subscription quota ID. - */ - private String quotaId; - - /* - * The subscription spending limit. - */ - private SpendingLimit spendingLimit; - +public interface SubscriptionPolicies { /** - * Creates an instance of SubscriptionPolicies class. - */ - public SubscriptionPolicies() { - } - - /** - * Get the locationPlacementId property: The subscription location placement ID. The ID indicates which regions are - * visible for a subscription. For example, a subscription with a location placement Id of Public_2014-09-01 has - * access to Azure public regions. + * Create or Update Subscription tenant policy for user's tenant. * - * @return the locationPlacementId value. + * @param body The body parameter. + * @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 tenant policy Information along with {@link Response}. */ - public String locationPlacementId() { - return this.locationPlacementId; - } + Response addUpdatePolicyForTenantWithResponse(PutTenantPolicyRequestProperties body, + Context context); /** - * Get the quotaId property: The subscription quota ID. + * Create or Update Subscription tenant policy for user's tenant. * - * @return the quotaId value. + * @param body The body parameter. + * @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 tenant policy Information. */ - public String quotaId() { - return this.quotaId; - } + GetTenantPolicyResponse addUpdatePolicyForTenant(PutTenantPolicyRequestProperties body); /** - * Get the spendingLimit property: The subscription spending limit. + * Get the subscription tenant policy for the user's tenant. * - * @return the spendingLimit value. + * @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 subscription tenant policy for the user's tenant along with {@link Response}. */ - public SpendingLimit spendingLimit() { - return this.spendingLimit; - } + Response getPolicyForTenantWithResponse(Context context); /** - * Validates the instance. + * Get the subscription tenant policy for the user's tenant. * - * @throws IllegalArgumentException thrown if the instance is not valid. + * @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 subscription tenant policy for the user's tenant. */ - public void validate() { - } + GetTenantPolicyResponse getPolicyForTenant(); /** - * {@inheritDoc} + * Get the subscription tenant policy for the user's tenant. + * + * @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 subscription tenant policy for the user's tenant as paginated response with {@link PagedIterable}. */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } + PagedIterable listPolicyForTenant(); /** - * Reads an instance of SubscriptionPolicies from the JsonReader. + * Get the subscription tenant policy for the user's tenant. * - * @param jsonReader The JsonReader being read. - * @return An instance of SubscriptionPolicies 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 SubscriptionPolicies. + * @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 subscription tenant policy for the user's tenant as paginated response with {@link PagedIterable}. */ - public static SubscriptionPolicies fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - SubscriptionPolicies deserializedSubscriptionPolicies = new SubscriptionPolicies(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("locationPlacementId".equals(fieldName)) { - deserializedSubscriptionPolicies.locationPlacementId = reader.getString(); - } else if ("quotaId".equals(fieldName)) { - deserializedSubscriptionPolicies.quotaId = reader.getString(); - } else if ("spendingLimit".equals(fieldName)) { - deserializedSubscriptionPolicies.spendingLimit = SpendingLimit.fromString(reader.getString()); - } else { - reader.skipChildren(); - } - } - - return deserializedSubscriptionPolicies; - }); - } + PagedIterable listPolicyForTenant(Context context); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionState.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionState.java deleted file mode 100644 index 3bf0a8ad5434..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/SubscriptionState.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.models; - -/** - * The subscription state. Possible values are Enabled, Warned, PastDue, Disabled, and Deleted. - */ -public enum SubscriptionState { - /** - * Enum value Enabled. - */ - ENABLED("Enabled"), - - /** - * Enum value Warned. - */ - WARNED("Warned"), - - /** - * Enum value PastDue. - */ - PAST_DUE("PastDue"), - - /** - * Enum value Disabled. - */ - DISABLED("Disabled"), - - /** - * Enum value Deleted. - */ - DELETED("Deleted"); - - /** - * The actual serialized value for a SubscriptionState instance. - */ - private final String value; - - SubscriptionState(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a SubscriptionState instance. - * - * @param value the serialized value to parse. - * @return the parsed SubscriptionState object, or null if unable to parse. - */ - public static SubscriptionState fromString(String value) { - if (value == null) { - return null; - } - SubscriptionState[] items = SubscriptionState.values(); - for (SubscriptionState item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Subscriptions.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Subscriptions.java index 180392cd5652..8588d8407422 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Subscriptions.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/Subscriptions.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.subscription.models; -import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; @@ -13,74 +12,119 @@ */ public interface Subscriptions { /** - * Gets all available geo-locations. + * The operation to cancel a subscription. * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. - * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription 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 location list operation response as paginated response with {@link PagedIterable}. + * @return the ID of the canceled subscription along with {@link Response}. */ - PagedIterable listLocations(String subscriptionId); + Response cancelWithResponse(String subscriptionId, Context context); /** - * Gets all available geo-locations. + * The operation to cancel a subscription. * - * This operation provides all the locations that are available for resource providers; however, each resource - * provider may support a subset of this list. + * @param subscriptionId Subscription 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 ID of the canceled subscription. + */ + CanceledSubscriptionId cancel(String subscriptionId); + + /** + * The operation to rename a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. + * @param body Subscription 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 location list operation response as paginated response with {@link PagedIterable}. + * @return the ID of the subscriptions that is being renamed along with {@link Response}. */ - PagedIterable listLocations(String subscriptionId, Context context); + Response renameWithResponse(String subscriptionId, SubscriptionName body, Context context); /** - * Gets details about a specified subscription. + * The operation to rename a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription Id. + * @param body Subscription 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 ID of the subscriptions that is being renamed. + */ + RenamedSubscriptionId rename(String subscriptionId, SubscriptionName body); + + /** + * The operation to enable a subscription. + * + * @param subscriptionId Subscription 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 details about a specified subscription along with {@link Response}. + * @return the ID of the subscriptions that is being enabled along with {@link Response}. */ - Response getWithResponse(String subscriptionId, Context context); + Response enableWithResponse(String subscriptionId, Context context); /** - * Gets details about a specified subscription. + * The operation to enable a subscription. * - * @param subscriptionId The ID of the target subscription. + * @param subscriptionId Subscription 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 details about a specified subscription. + * @return the ID of the subscriptions that is being enabled. */ - Subscription get(String subscriptionId); + EnabledSubscriptionId enable(String subscriptionId); /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership. * + * @param subscriptionId Subscription Id. + * @param body The body parameter. + * @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 all subscriptions for a tenant as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + void acceptOwnership(String subscriptionId, AcceptOwnershipRequest body); /** - * Gets all subscriptions for a tenant. + * Accept subscription ownership. * + * @param subscriptionId Subscription Id. + * @param body The body parameter. * @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 all subscriptions for a tenant as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + void acceptOwnership(String subscriptionId, AcceptOwnershipRequest body, Context context); + + /** + * Accept subscription ownership status. + * + * @param subscriptionId Subscription 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 subscription Accept Ownership Response along with {@link Response}. + */ + Response acceptOwnershipStatusWithResponse(String subscriptionId, Context context); + + /** + * Accept subscription ownership status. + * + * @param subscriptionId Subscription 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 subscription Accept Ownership Response. + */ + AcceptOwnershipStatusResponse acceptOwnershipStatus(String subscriptionId); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/TenantIdDescription.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/TenantIdDescription.java deleted file mode 100644 index 428bd5716c69..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/TenantIdDescription.java +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.models; - -import com.azure.resourcemanager.subscription.fluent.models.TenantIdDescriptionInner; - -/** - * An immutable client-side representation of TenantIdDescription. - */ -public interface TenantIdDescription { - /** - * Gets the id property: The fully qualified ID of the tenant. For example, - * /tenants/00000000-0000-0000-0000-000000000000. - * - * @return the id value. - */ - String id(); - - /** - * Gets the tenantId property: The tenant ID. For example, 00000000-0000-0000-0000-000000000000. - * - * @return the tenantId value. - */ - String tenantId(); - - /** - * Gets the tenantCategory property: The category of the tenant. Possible values are - * TenantCategoryHome,TenantCategoryProjectedBy,TenantCategoryManagedBy. - * - * @return the tenantCategory value. - */ - String tenantCategory(); - - /** - * Gets the country property: The country/region name of the address for the tenant. - * - * @return the country value. - */ - String country(); - - /** - * Gets the countryCode property: The Country/region abbreviation for the tenant. - * - * @return the countryCode value. - */ - String countryCode(); - - /** - * Gets the displayName property: The display name of the tenant. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the domains property: The list of domains for the tenant. - * - * @return the domains value. - */ - String domains(); - - /** - * Gets the defaultDomain property: The default domain for the tenant. - * - * @return the defaultDomain value. - */ - String defaultDomain(); - - /** - * Gets the tenantType property: The tenant type. Only available for Home tenant category. - * - * @return the tenantType value. - */ - String tenantType(); - - /** - * Gets the inner com.azure.resourcemanager.subscription.fluent.models.TenantIdDescriptionInner object. - * - * @return the inner object. - */ - TenantIdDescriptionInner innerModel(); -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/TenantListResult.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/TenantListResult.java deleted file mode 100644 index efcca9b93d6c..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/TenantListResult.java +++ /dev/null @@ -1,136 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import com.azure.resourcemanager.subscription.fluent.models.TenantIdDescriptionInner; -import java.io.IOException; -import java.util.List; - -/** - * Tenant Ids information. - */ -@Fluent -public final class TenantListResult implements JsonSerializable { - /* - * An array of tenants. - */ - private List value; - - /* - * The URL to use for getting the next set of results. - */ - private String nextLink; - - /** - * Creates an instance of TenantListResult class. - */ - public TenantListResult() { - } - - /** - * Get the value property: An array of tenants. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Set the value property: An array of tenants. - * - * @param value the value value to set. - * @return the TenantListResult object itself. - */ - public TenantListResult withValue(List value) { - this.value = value; - return this; - } - - /** - * Get the nextLink property: The URL to use for getting the next set of results. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Set the nextLink property: The URL to use for getting the next set of results. - * - * @param nextLink the nextLink value to set. - * @return the TenantListResult object itself. - */ - public TenantListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - if (nextLink() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property nextLink in model TenantListResult")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TenantListResult.class); - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("nextLink", this.nextLink); - jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of TenantListResult from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of TenantListResult 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 TenantListResult. - */ - public static TenantListResult fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - TenantListResult deserializedTenantListResult = new TenantListResult(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("nextLink".equals(fieldName)) { - deserializedTenantListResult.nextLink = reader.getString(); - } else if ("value".equals(fieldName)) { - List value - = reader.readArray(reader1 -> TenantIdDescriptionInner.fromJson(reader1)); - deserializedTenantListResult.value = value; - } else { - reader.skipChildren(); - } - } - - return deserializedTenantListResult; - }); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/TenantPolicy.java b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/TenantPolicy.java new file mode 100644 index 000000000000..b7e0bedddbbb --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/java/com/azure/resourcemanager/subscription/models/TenantPolicy.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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; +import java.util.Objects; +import java.util.UUID; + +/** + * Tenant policy. + */ +@Fluent +public final class TenantPolicy implements JsonSerializable { + /* + * Policy Id. + */ + private String policyId; + + /* + * Blocks the leaving of subscriptions from user's tenant. + */ + private Boolean blockSubscriptionsLeavingTenant; + + /* + * Blocks the entering of subscriptions into user's tenant. + */ + private Boolean blockSubscriptionsIntoTenant; + + /* + * List of user objectIds that are exempted from the set subscription tenant policies for the user's tenant. + */ + private List exemptedPrincipals; + + /** + * Creates an instance of TenantPolicy class. + */ + public TenantPolicy() { + } + + /** + * Get the policyId property: Policy Id. + * + * @return the policyId value. + */ + public String policyId() { + return this.policyId; + } + + /** + * Get the blockSubscriptionsLeavingTenant property: Blocks the leaving of subscriptions from user's tenant. + * + * @return the blockSubscriptionsLeavingTenant value. + */ + public Boolean blockSubscriptionsLeavingTenant() { + return this.blockSubscriptionsLeavingTenant; + } + + /** + * Set the blockSubscriptionsLeavingTenant property: Blocks the leaving of subscriptions from user's tenant. + * + * @param blockSubscriptionsLeavingTenant the blockSubscriptionsLeavingTenant value to set. + * @return the TenantPolicy object itself. + */ + public TenantPolicy withBlockSubscriptionsLeavingTenant(Boolean blockSubscriptionsLeavingTenant) { + this.blockSubscriptionsLeavingTenant = blockSubscriptionsLeavingTenant; + return this; + } + + /** + * Get the blockSubscriptionsIntoTenant property: Blocks the entering of subscriptions into user's tenant. + * + * @return the blockSubscriptionsIntoTenant value. + */ + public Boolean blockSubscriptionsIntoTenant() { + return this.blockSubscriptionsIntoTenant; + } + + /** + * Set the blockSubscriptionsIntoTenant property: Blocks the entering of subscriptions into user's tenant. + * + * @param blockSubscriptionsIntoTenant the blockSubscriptionsIntoTenant value to set. + * @return the TenantPolicy object itself. + */ + public TenantPolicy withBlockSubscriptionsIntoTenant(Boolean blockSubscriptionsIntoTenant) { + this.blockSubscriptionsIntoTenant = blockSubscriptionsIntoTenant; + return this; + } + + /** + * Get the exemptedPrincipals property: List of user objectIds that are exempted from the set subscription tenant + * policies for the user's tenant. + * + * @return the exemptedPrincipals value. + */ + public List exemptedPrincipals() { + return this.exemptedPrincipals; + } + + /** + * Set the exemptedPrincipals property: List of user objectIds that are exempted from the set subscription tenant + * policies for the user's tenant. + * + * @param exemptedPrincipals the exemptedPrincipals value to set. + * @return the TenantPolicy object itself. + */ + public TenantPolicy withExemptedPrincipals(List exemptedPrincipals) { + this.exemptedPrincipals = exemptedPrincipals; + return this; + } + + /** + * 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(); + jsonWriter.writeBooleanField("blockSubscriptionsLeavingTenant", this.blockSubscriptionsLeavingTenant); + jsonWriter.writeBooleanField("blockSubscriptionsIntoTenant", this.blockSubscriptionsIntoTenant); + jsonWriter.writeArrayField("exemptedPrincipals", this.exemptedPrincipals, + (writer, element) -> writer.writeString(Objects.toString(element, null))); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TenantPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TenantPolicy 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 TenantPolicy. + */ + public static TenantPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TenantPolicy deserializedTenantPolicy = new TenantPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("policyId".equals(fieldName)) { + deserializedTenantPolicy.policyId = reader.getString(); + } else if ("blockSubscriptionsLeavingTenant".equals(fieldName)) { + deserializedTenantPolicy.blockSubscriptionsLeavingTenant + = reader.getNullable(JsonReader::getBoolean); + } else if ("blockSubscriptionsIntoTenant".equals(fieldName)) { + deserializedTenantPolicy.blockSubscriptionsIntoTenant = reader.getNullable(JsonReader::getBoolean); + } else if ("exemptedPrincipals".equals(fieldName)) { + List exemptedPrincipals = reader.readArray( + reader1 -> reader1.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()))); + deserializedTenantPolicy.exemptedPrincipals = exemptedPrincipals; + } else { + reader.skipChildren(); + } + } + + return deserializedTenantPolicy; + }); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-subscription/proxy-config.json b/sdk/subscription/azure-resourcemanager-subscription/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-subscription/proxy-config.json index abba0d3463d2..2084c95c320c 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-subscription/proxy-config.json +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-subscription/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.subscription.implementation.AliasClientImpl$AliasService"],["com.azure.resourcemanager.subscription.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.subscription.implementation.SubscriptionOperationsClientImpl$SubscriptionOperationsService"],["com.azure.resourcemanager.subscription.implementation.SubscriptionsClientImpl$SubscriptionsService"],["com.azure.resourcemanager.subscription.implementation.TenantsClientImpl$TenantsService"]] \ No newline at end of file +[["com.azure.resourcemanager.subscription.implementation.AliasClientImpl$AliasService"],["com.azure.resourcemanager.subscription.implementation.BillingAccountsClientImpl$BillingAccountsService"],["com.azure.resourcemanager.subscription.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.subscription.implementation.SubscriptionOperationsClientImpl$SubscriptionOperationsService"],["com.azure.resourcemanager.subscription.implementation.SubscriptionPoliciesClientImpl$SubscriptionPoliciesService"],["com.azure.resourcemanager.subscription.implementation.SubscriptionsClientImpl$SubscriptionsService"]] \ No newline at end of file diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/main/resources/azure-resourcemanager-subscription.properties b/sdk/subscription/azure-resourcemanager-subscription/src/main/resources/azure-resourcemanager-subscription.properties new file mode 100644 index 000000000000..defbd48204e4 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/main/resources/azure-resourcemanager-subscription.properties @@ -0,0 +1 @@ +version=${project.version} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasCreateSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasCreateSamples.java index c81077d6dfaa..12197a333214 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasCreateSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasCreateSamples.java @@ -5,8 +5,11 @@ package com.azure.resourcemanager.subscription.generated; import com.azure.resourcemanager.subscription.models.PutAliasRequest; +import com.azure.resourcemanager.subscription.models.PutAliasRequestAdditionalProperties; import com.azure.resourcemanager.subscription.models.PutAliasRequestProperties; import com.azure.resourcemanager.subscription.models.Workload; +import java.util.HashMap; +import java.util.Map; /** * Samples for Alias Create. @@ -14,7 +17,7 @@ public final class AliasCreateSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/createAlias.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/createAlias.json */ /** * Sample code: CreateAlias. @@ -24,10 +27,26 @@ public final class AliasCreateSamples { public static void createAlias(com.azure.resourcemanager.subscription.SubscriptionManager manager) { manager.alias() .create("aliasForNewSub", new PutAliasRequest().withProperties(new PutAliasRequestProperties() - .withDisplayName("Contoso MCA subscription") + .withDisplayName("Test Subscription") .withWorkload(Workload.PRODUCTION) .withBillingScope( - "/providers/Microsoft.Billing/billingAccounts/e879cf0f-2b4d-5431-109a-f72fc9868693:024cabf4-7321-4cf9-be59-df0c77ca51de_2019-05-31/billingProfiles/PE2Q-NOIT-BG7-TGB/invoiceSections/MTT4-OBS7-PJA-TGB")), + "/billingAccounts/af6231a7-7f8d-4fcc-a993-dd8466108d07:c663dac6-a9a5-405a-8938-cd903e12ab5b_2019_05_31/billingProfiles/QWDQ-QWHI-AUW-SJDO-DJH/invoiceSections/FEUF-EUHE-ISJ-SKDW-DJH") + .withAdditionalProperties(new PutAliasRequestAdditionalProperties() + .withSubscriptionTenantId("66f6e4d6-07dc-4aea-94ea-e12d3026a3c8") + .withSubscriptionOwnerId("f09b39eb-c496-482c-9ab9-afd799572f4c") + .withTags(mapOf("tag1", "Messi", "tag2", "Ronaldo", "tag3", "Lebron")))), 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/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasDeleteSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasDeleteSamples.java index 206e295a25be..debf18311a68 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasDeleteSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasDeleteSamples.java @@ -10,7 +10,7 @@ public final class AliasDeleteSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/deleteAlias.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/deleteAlias.json */ /** * Sample code: DeleteAlias. diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasGetSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasGetSamples.java index b4cbe49f0ddc..7f5e2b6d30d1 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasGetSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasGetSamples.java @@ -10,7 +10,7 @@ public final class AliasGetSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/getAlias.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getAlias.json */ /** * Sample code: GetAlias. diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasListSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasListSamples.java index 42eb69959824..67a0b7da5ced 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasListSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/AliasListSamples.java @@ -10,14 +10,14 @@ public final class AliasListSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/listAlias.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/listAlias.json */ /** - * Sample code: GetAlias. + * Sample code: ListAlias. * * @param manager Entry point to SubscriptionManager. */ - public static void getAlias(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + public static void listAlias(com.azure.resourcemanager.subscription.SubscriptionManager manager) { manager.alias().listWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/BillingAccountGetPolicySamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/BillingAccountGetPolicySamples.java new file mode 100644 index 000000000000..35539ec2903f --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/BillingAccountGetPolicySamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +/** + * Samples for BillingAccount GetPolicy. + */ +public final class BillingAccountGetPolicySamples { + /* + * x-ms-original-file: + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/ + * getBillingAccountPolicy.json + */ + /** + * Sample code: GetBillingAccountPolicy. + * + * @param manager Entry point to SubscriptionManager. + */ + public static void getBillingAccountPolicy(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.billingAccounts().getPolicyWithResponse("testBillingAccountId", com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/OperationsListSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/OperationsListSamples.java index 2c20ee781dca..a1d72ff74b3d 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/OperationsListSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/OperationsListSamples.java @@ -10,7 +10,7 @@ public final class OperationsListSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/getOperations.json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getOperations.json */ /** * Sample code: getOperations. @@ -18,6 +18,6 @@ public final class OperationsListSamples { * @param manager Entry point to SubscriptionManager. */ public static void getOperations(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.operations().listWithResponse(com.azure.core.util.Context.NONE); + manager.operations().list(com.azure.core.util.Context.NONE); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionAcceptOwnershipSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionAcceptOwnershipSamples.java new file mode 100644 index 000000000000..88446eec630c --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionAcceptOwnershipSamples.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequest; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequestProperties; +import java.util.HashMap; +import java.util.Map; + +/** + * Samples for Subscription AcceptOwnership. + */ +public final class SubscriptionAcceptOwnershipSamples { + /* + * x-ms-original-file: + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/ + * acceptSubscriptionOwnership.json + */ + /** + * Sample code: AcceptOwnership. + * + * @param manager Entry point to SubscriptionManager. + */ + public static void acceptOwnership(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptions() + .acceptOwnership("291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + new AcceptOwnershipRequest() + .withProperties(new AcceptOwnershipRequestProperties().withDisplayName("Test Subscription") + .withTags(mapOf("tag1", "Messi", "tag2", "Ronaldo", "tag3", "Lebron"))), + 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/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionAcceptOwnershipStatusSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionAcceptOwnershipStatusSamples.java new file mode 100644 index 000000000000..645ec03f9533 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionAcceptOwnershipStatusSamples.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +/** + * Samples for Subscription AcceptOwnershipStatus. + */ +public final class SubscriptionAcceptOwnershipStatusSamples { + /* + * x-ms-original-file: + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/ + * acceptOwnershipStatus.json + */ + /** + * Sample code: AcceptOwnershipStatus. + * + * @param manager Entry point to SubscriptionManager. + */ + public static void acceptOwnershipStatus(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptions() + .acceptOwnershipStatusWithResponse("291bba3f-e0a5-47bc-a099-3bdcb2a50a05", + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationCancelSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionCancelSamples.java similarity index 77% rename from sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationCancelSamples.java rename to sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionCancelSamples.java index e16be4946a48..1ee4694d52e4 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationCancelSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionCancelSamples.java @@ -5,12 +5,12 @@ package com.azure.resourcemanager.subscription.generated; /** - * Samples for SubscriptionOperation Cancel. + * Samples for Subscription Cancel. */ -public final class SubscriptionOperationCancelSamples { +public final class SubscriptionCancelSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/cancelSubscription. + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/cancelSubscription. * json */ /** @@ -19,7 +19,7 @@ public final class SubscriptionOperationCancelSamples { * @param manager Entry point to SubscriptionManager. */ public static void cancelSubscription(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptionOperations() + manager.subscriptions() .cancelWithResponse("83aa47df-e3e9-49ff-877b-94304bf3d3ad", com.azure.core.util.Context.NONE); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationEnableSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionEnableSamples.java similarity index 77% rename from sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationEnableSamples.java rename to sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionEnableSamples.java index 32f811ba5b4a..39b2f61bcac6 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationEnableSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionEnableSamples.java @@ -5,12 +5,12 @@ package com.azure.resourcemanager.subscription.generated; /** - * Samples for SubscriptionOperation Enable. + * Samples for Subscription Enable. */ -public final class SubscriptionOperationEnableSamples { +public final class SubscriptionEnableSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/enableSubscription. + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/enableSubscription. * json */ /** @@ -19,7 +19,7 @@ public final class SubscriptionOperationEnableSamples { * @param manager Entry point to SubscriptionManager. */ public static void enableSubscription(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptionOperations() + manager.subscriptions() .enableWithResponse("7948bcee-488c-47ce-941c-38e20ede803d", com.azure.core.util.Context.NONE); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionsListSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationGetSamples.java similarity index 50% rename from sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionsListSamples.java rename to sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationGetSamples.java index b8ab1d881944..6b35a515b2d2 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionsListSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationGetSamples.java @@ -5,20 +5,22 @@ package com.azure.resourcemanager.subscription.generated; /** - * Samples for Subscriptions List. + * Samples for SubscriptionOperation Get. */ -public final class SubscriptionsListSamples { +public final class SubscriptionOperationGetSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/listSubscriptions. - * json + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/ + * getSubscriptionOperation.json */ /** - * Sample code: listSubscriptions. + * Sample code: getPendingSubscriptionOperations. * * @param manager Entry point to SubscriptionManager. */ - public static void listSubscriptions(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptions().list(com.azure.core.util.Context.NONE); + public static void + getPendingSubscriptionOperations(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptionOperations() + .getWithResponse("e4b8d068-f574-462a-a76f-6fa0afc613c9", com.azure.core.util.Context.NONE); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionPolicyAddUpdatePolicyForTenantSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionPolicyAddUpdatePolicyForTenantSamples.java new file mode 100644 index 000000000000..594fdf89684f --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionPolicyAddUpdatePolicyForTenantSamples.java @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.resourcemanager.subscription.models.PutTenantPolicyRequestProperties; +import java.util.Arrays; +import java.util.UUID; + +/** + * Samples for SubscriptionPolicy AddUpdatePolicyForTenant. + */ +public final class SubscriptionPolicyAddUpdatePolicyForTenantSamples { + /* + * x-ms-original-file: + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/changeTenantPolicy. + * json + */ + /** + * Sample code: TenantPolicy. + * + * @param manager Entry point to SubscriptionManager. + */ + public static void tenantPolicy(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptionPolicies() + .addUpdatePolicyForTenantWithResponse( + new PutTenantPolicyRequestProperties().withBlockSubscriptionsLeavingTenant(true) + .withBlockSubscriptionsIntoTenant(true) + .withExemptedPrincipals(Arrays.asList(UUID.fromString("e879cf0f-2b4d-5431-109a-f72fc9868693"), + UUID.fromString("9792da87-c97b-410d-a97d-27021ba09ce6"))), + com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionsGetSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionPolicyGetPolicyForTenantSamples.java similarity index 55% rename from sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionsGetSamples.java rename to sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionPolicyGetPolicyForTenantSamples.java index b69a91e0b4db..1e5d9a107b0f 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionsGetSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionPolicyGetPolicyForTenantSamples.java @@ -5,21 +5,20 @@ package com.azure.resourcemanager.subscription.generated; /** - * Samples for Subscriptions Get. + * Samples for SubscriptionPolicy GetPolicyForTenant. */ -public final class SubscriptionsGetSamples { +public final class SubscriptionPolicyGetPolicyForTenantSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/getSubscription. + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicy. * json */ /** - * Sample code: getSubscription. + * Sample code: getTenantPolicy. * * @param manager Entry point to SubscriptionManager. */ - public static void getSubscription(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptions() - .getWithResponse("83aa47df-e3e9-49ff-877b-94304bf3d3ad", com.azure.core.util.Context.NONE); + public static void getTenantPolicy(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptionPolicies().getPolicyForTenantWithResponse(com.azure.core.util.Context.NONE); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionPolicyListPolicyForTenantSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionPolicyListPolicyForTenantSamples.java new file mode 100644 index 000000000000..fb84c22b7868 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionPolicyListPolicyForTenantSamples.java @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +/** + * Samples for SubscriptionPolicy ListPolicyForTenant. + */ +public final class SubscriptionPolicyListPolicyForTenantSamples { + /* + * x-ms-original-file: + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/getTenantPolicyList + * .json + */ + /** + * Sample code: getTenantPolicyList. + * + * @param manager Entry point to SubscriptionManager. + */ + public static void getTenantPolicyList(com.azure.resourcemanager.subscription.SubscriptionManager manager) { + manager.subscriptionPolicies().listPolicyForTenant(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationRenameSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionRenameSamples.java similarity index 80% rename from sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationRenameSamples.java rename to sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionRenameSamples.java index 65fe11fc3288..1e73f83c7738 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationRenameSamples.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionRenameSamples.java @@ -7,12 +7,12 @@ import com.azure.resourcemanager.subscription.models.SubscriptionName; /** - * Samples for SubscriptionOperation Rename. + * Samples for Subscription Rename. */ -public final class SubscriptionOperationRenameSamples { +public final class SubscriptionRenameSamples { /* * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2020-09-01/examples/renameSubscription. + * specification/subscription/resource-manager/Microsoft.Subscription/stable/2021-10-01/examples/renameSubscription. * json */ /** @@ -21,7 +21,7 @@ public final class SubscriptionOperationRenameSamples { * @param manager Entry point to SubscriptionManager. */ public static void renameSubscription(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptionOperations() + manager.subscriptions() .renameWithResponse("83aa47df-e3e9-49ff-877b-94304bf3d3ad", new SubscriptionName().withSubscriptionName("Test Sub"), com.azure.core.util.Context.NONE); } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionsListLocationsSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionsListLocationsSamples.java deleted file mode 100644 index baf547d28928..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/SubscriptionsListLocationsSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -/** - * Samples for Subscriptions ListLocations. - */ -public final class SubscriptionsListLocationsSamples { - /* - * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/listLocations.json - */ - /** - * Sample code: listLocations. - * - * @param manager Entry point to SubscriptionManager. - */ - public static void listLocations(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.subscriptions().listLocations("83aa47df-e3e9-49ff-877b-94304bf3d3ad", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/TenantsListSamples.java b/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/TenantsListSamples.java deleted file mode 100644 index d4819fa64e29..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/samples/java/com/azure/resourcemanager/subscription/generated/TenantsListSamples.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -/** - * Samples for Tenants List. - */ -public final class TenantsListSamples { - /* - * x-ms-original-file: - * specification/subscription/resource-manager/Microsoft.Subscription/stable/2016-06-01/examples/listTenants.json - */ - /** - * Sample code: listTenants. - * - * @param manager Entry point to SubscriptionManager. - */ - public static void listTenants(com.azure.resourcemanager.subscription.SubscriptionManager manager) { - manager.tenants().list(com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AcceptOwnershipRequestPropertiesTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AcceptOwnershipRequestPropertiesTests.java new file mode 100644 index 000000000000..bb797ec1b0ff --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AcceptOwnershipRequestPropertiesTests.java @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequestProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AcceptOwnershipRequestPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AcceptOwnershipRequestProperties model = BinaryData.fromString( + "{\"displayName\":\"cxtbzsg\",\"managementGroupId\":\"c\",\"tags\":{\"jeiachboosfl\":\"ewmdw\",\"fqpte\":\"ro\",\"i\":\"hzzvypyq\",\"npvswjdkirso\":\"z\"}}") + .toObject(AcceptOwnershipRequestProperties.class); + Assertions.assertEquals("cxtbzsg", model.displayName()); + Assertions.assertEquals("c", model.managementGroupId()); + Assertions.assertEquals("ewmdw", model.tags().get("jeiachboosfl")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AcceptOwnershipRequestProperties model = new AcceptOwnershipRequestProperties().withDisplayName("cxtbzsg") + .withManagementGroupId("c") + .withTags(mapOf("jeiachboosfl", "ewmdw", "fqpte", "ro", "i", "hzzvypyq", "npvswjdkirso", "z")); + model = BinaryData.fromObject(model).toObject(AcceptOwnershipRequestProperties.class); + Assertions.assertEquals("cxtbzsg", model.displayName()); + Assertions.assertEquals("c", model.managementGroupId()); + Assertions.assertEquals("ewmdw", model.tags().get("jeiachboosfl")); + } + + // 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/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AcceptOwnershipRequestTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AcceptOwnershipRequestTests.java new file mode 100644 index 000000000000..28ba61ae23d6 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AcceptOwnershipRequestTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequest; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipRequestProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AcceptOwnershipRequestTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AcceptOwnershipRequest model = BinaryData.fromString( + "{\"properties\":{\"displayName\":\"thwxmnteiwaopvkm\",\"managementGroupId\":\"c\",\"tags\":{\"fsrpymzidnse\":\"dcuf\"}}}") + .toObject(AcceptOwnershipRequest.class); + Assertions.assertEquals("thwxmnteiwaopvkm", model.properties().displayName()); + Assertions.assertEquals("c", model.properties().managementGroupId()); + Assertions.assertEquals("dcuf", model.properties().tags().get("fsrpymzidnse")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AcceptOwnershipRequest model = new AcceptOwnershipRequest() + .withProperties(new AcceptOwnershipRequestProperties().withDisplayName("thwxmnteiwaopvkm") + .withManagementGroupId("c") + .withTags(mapOf("fsrpymzidnse", "dcuf"))); + model = BinaryData.fromObject(model).toObject(AcceptOwnershipRequest.class); + Assertions.assertEquals("thwxmnteiwaopvkm", model.properties().displayName()); + Assertions.assertEquals("c", model.properties().managementGroupId()); + Assertions.assertEquals("dcuf", model.properties().tags().get("fsrpymzidnse")); + } + + // 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/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AcceptOwnershipStatusResponseInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AcceptOwnershipStatusResponseInnerTests.java new file mode 100644 index 000000000000..4ae60bd7cea5 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AcceptOwnershipStatusResponseInnerTests.java @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.fluent.models.AcceptOwnershipStatusResponseInner; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class AcceptOwnershipStatusResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + AcceptOwnershipStatusResponseInner model = BinaryData.fromString( + "{\"subscriptionId\":\"qxhcrmn\",\"acceptOwnershipState\":\"Expired\",\"provisioningState\":\"Accepted\",\"billingOwner\":\"whdsoifiyip\",\"subscriptionTenantId\":\"sqwpgrjb\",\"displayName\":\"orcjxvsnby\",\"tags\":{\"pcyshu\":\"bnmo\",\"jjgpb\":\"zafb\",\"jmkljavbqidtqajz\":\"oq\"}}") + .toObject(AcceptOwnershipStatusResponseInner.class); + Assertions.assertEquals("sqwpgrjb", model.subscriptionTenantId()); + Assertions.assertEquals("orcjxvsnby", model.displayName()); + Assertions.assertEquals("bnmo", model.tags().get("pcyshu")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + AcceptOwnershipStatusResponseInner model + = new AcceptOwnershipStatusResponseInner().withSubscriptionTenantId("sqwpgrjb") + .withDisplayName("orcjxvsnby") + .withTags(mapOf("pcyshu", "bnmo", "jjgpb", "zafb", "jmkljavbqidtqajz", "oq")); + model = BinaryData.fromObject(model).toObject(AcceptOwnershipStatusResponseInner.class); + Assertions.assertEquals("sqwpgrjb", model.subscriptionTenantId()); + Assertions.assertEquals("orcjxvsnby", model.displayName()); + Assertions.assertEquals("bnmo", model.tags().get("pcyshu")); + } + + // 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/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasCreateMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasCreateMockTests.java index f1be02f28192..8a25390d6254 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasCreateMockTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasCreateMockTests.java @@ -6,17 +6,20 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.subscription.SubscriptionManager; import com.azure.resourcemanager.subscription.models.ProvisioningState; import com.azure.resourcemanager.subscription.models.PutAliasRequest; +import com.azure.resourcemanager.subscription.models.PutAliasRequestAdditionalProperties; import com.azure.resourcemanager.subscription.models.PutAliasRequestProperties; -import com.azure.resourcemanager.subscription.models.PutAliasResponse; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasResponse; import com.azure.resourcemanager.subscription.models.Workload; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -25,24 +28,49 @@ public final class AliasCreateMockTests { @Test public void testCreate() throws Exception { String responseStr - = "{\"properties\":{\"subscriptionId\":\"c\",\"provisioningState\":\"Succeeded\"},\"id\":\"wooc\",\"name\":\"cbonqvpk\",\"type\":\"lrxnjeaseiphe\"}"; + = "{\"properties\":{\"subscriptionId\":\"hfiqscjeypvhe\",\"displayName\":\"kgqhcjrefovg\",\"provisioningState\":\"Succeeded\",\"acceptOwnershipUrl\":\"leyyvx\",\"acceptOwnershipState\":\"Expired\",\"billingScope\":\"k\",\"workload\":\"Production\",\"resellerId\":\"pngjcrcczsqpjhvm\",\"subscriptionOwnerId\":\"jvnysounqe\",\"managementGroupId\":\"noae\",\"createdTime\":\"fhyhltrpmopjmcma\",\"tags\":{\"aodsfcpkv\":\"kthfui\"}},\"id\":\"dpuozmyz\",\"name\":\"dagfuaxbezyiuok\",\"type\":\"twhrdxwzywqsm\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SubscriptionManager manager = SubscriptionManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PutAliasResponse response = manager.alias() - .create("cfionl", - new PutAliasRequest().withProperties(new PutAliasRequestProperties().withDisplayName("x") - .withWorkload(Workload.PRODUCTION) - .withBillingScope("tzxdpnqbqqwx") - .withSubscriptionId("feallnwsu") - .withResellerId("snjampmng")), + SubscriptionAliasResponse response = manager.alias() + .create("dejbavo", + new PutAliasRequest().withProperties(new PutAliasRequestProperties().withDisplayName("dmoh") + .withWorkload(Workload.DEV_TEST) + .withBillingScope("vudwx") + .withSubscriptionId("dnvowg") + .withResellerId("jugwdkcglhsl") + .withAdditionalProperties( + new PutAliasRequestAdditionalProperties().withManagementGroupId("dyggdtjixhbku") + .withSubscriptionTenantId("qweykhmenev") + .withSubscriptionOwnerId("exfwhy") + .withTags(mapOf("naamde", "bvyvdcsity")))), com.azure.core.util.Context.NONE); + Assertions.assertEquals("kgqhcjrefovg", response.properties().displayName()); Assertions.assertEquals(ProvisioningState.SUCCEEDED, response.properties().provisioningState()); + Assertions.assertEquals("k", response.properties().billingScope()); + Assertions.assertEquals(Workload.PRODUCTION, response.properties().workload()); + Assertions.assertEquals("pngjcrcczsqpjhvm", response.properties().resellerId()); + Assertions.assertEquals("jvnysounqe", response.properties().subscriptionOwnerId()); + Assertions.assertEquals("noae", response.properties().managementGroupId()); + Assertions.assertEquals("fhyhltrpmopjmcma", response.properties().createdTime()); + Assertions.assertEquals("kthfui", response.properties().tags().get("aodsfcpkv")); + } + + // 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/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasDeleteWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasDeleteWithResponseMockTests.java index 23aafa58ef16..b402e9bbaaa8 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasDeleteWithResponseMockTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasDeleteWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.subscription.SubscriptionManager; import java.nio.charset.StandardCharsets; @@ -25,9 +25,9 @@ public void testDeleteWithResponse() throws Exception { SubscriptionManager manager = SubscriptionManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - manager.alias().deleteWithResponse("wdslfhotwmcy", com.azure.core.util.Context.NONE); + manager.alias().deleteWithResponse("kcciwwzjuqkhr", com.azure.core.util.Context.NONE); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasGetWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasGetWithResponseMockTests.java index b8dcc0e01202..71f234403638 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasGetWithResponseMockTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasGetWithResponseMockTests.java @@ -6,12 +6,13 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.subscription.SubscriptionManager; import com.azure.resourcemanager.subscription.models.ProvisioningState; -import com.azure.resourcemanager.subscription.models.PutAliasResponse; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasResponse; +import com.azure.resourcemanager.subscription.models.Workload; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Assertions; @@ -22,17 +23,26 @@ public final class AliasGetWithResponseMockTests { @Test public void testGetWithResponse() throws Exception { String responseStr - = "{\"properties\":{\"subscriptionId\":\"eyy\",\"provisioningState\":\"Failed\"},\"id\":\"jbdlwtgrhpdjpju\",\"name\":\"asxazjpqyegualhb\",\"type\":\"xhejjzzvdud\"}"; + = "{\"properties\":{\"subscriptionId\":\"ryocfsfksymdd\",\"displayName\":\"tki\",\"provisioningState\":\"Failed\",\"acceptOwnershipUrl\":\"qyud\",\"acceptOwnershipState\":\"Expired\",\"billingScope\":\"qn\",\"workload\":\"Production\",\"resellerId\":\"zvyifqrvkdvj\",\"subscriptionOwnerId\":\"lrmv\",\"managementGroupId\":\"f\",\"createdTime\":\"t\",\"tags\":{\"ruwiqzbqjvsov\":\"pulexxbczw\"}},\"id\":\"okacspk\",\"name\":\"lhzdobp\",\"type\":\"jmflbvvnch\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SubscriptionManager manager = SubscriptionManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PutAliasResponse response = manager.alias().getWithResponse("f", com.azure.core.util.Context.NONE).getValue(); + SubscriptionAliasResponse response + = manager.alias().getWithResponse("surex", com.azure.core.util.Context.NONE).getValue(); + Assertions.assertEquals("tki", response.properties().displayName()); Assertions.assertEquals(ProvisioningState.FAILED, response.properties().provisioningState()); + Assertions.assertEquals("qn", response.properties().billingScope()); + Assertions.assertEquals(Workload.PRODUCTION, response.properties().workload()); + Assertions.assertEquals("zvyifqrvkdvj", response.properties().resellerId()); + Assertions.assertEquals("lrmv", response.properties().subscriptionOwnerId()); + Assertions.assertEquals("f", response.properties().managementGroupId()); + Assertions.assertEquals("t", response.properties().createdTime()); + Assertions.assertEquals("pulexxbczw", response.properties().tags().get("ruwiqzbqjvsov")); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasListWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasListWithResponseMockTests.java index fc02f09116b1..0716fed3fc55 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasListWithResponseMockTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/AliasListWithResponseMockTests.java @@ -6,11 +6,11 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.subscription.SubscriptionManager; -import com.azure.resourcemanager.subscription.models.PutAliasListResult; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasListResult; import java.nio.charset.StandardCharsets; import java.time.OffsetDateTime; import org.junit.jupiter.api.Test; @@ -20,16 +20,17 @@ public final class AliasListWithResponseMockTests { @Test public void testListWithResponse() throws Exception { String responseStr - = "{\"value\":[{\"properties\":{\"subscriptionId\":\"jnpg\",\"provisioningState\":\"Failed\"},\"id\":\"tadehxnltyfsopp\",\"name\":\"suesnzw\",\"type\":\"ej\"},{\"properties\":{\"subscriptionId\":\"orxzdmohctbqvud\",\"provisioningState\":\"Accepted\"},\"id\":\"ndnvo\",\"name\":\"gujjugwdkcglh\",\"type\":\"lazjdyggdtjixhbk\"},{\"properties\":{\"subscriptionId\":\"qweykhmenev\",\"provisioningState\":\"Succeeded\"},\"id\":\"xfw\",\"name\":\"ybcibvyvdcsit\",\"type\":\"nnaamdectehfiqsc\"},{\"properties\":{\"subscriptionId\":\"pvhez\",\"provisioningState\":\"Succeeded\"},\"id\":\"q\",\"name\":\"c\",\"type\":\"refovgmkqsleyyvx\"}],\"nextLink\":\"jpkcattpng\"}"; + = "{\"value\":[{\"properties\":{\"subscriptionId\":\"ku\",\"displayName\":\"oskg\",\"provisioningState\":\"Failed\",\"acceptOwnershipUrl\":\"uimjmvx\",\"acceptOwnershipState\":\"Pending\",\"billingScope\":\"ugidyjrr\",\"workload\":\"Production\",\"resellerId\":\"osvexcsonpclhoc\",\"subscriptionOwnerId\":\"slkevle\",\"managementGroupId\":\"zfbuhf\",\"createdTime\":\"faxkffeii\",\"tags\":{\"shxmzsbbzoggigrx\":\"vmezy\",\"ptkoenkoukn\":\"burvjxxjnspy\",\"ngkpocipazy\":\"udwtiukbl\",\"gukgjnpiucgygevq\":\"o\"}},\"id\":\"typmrbpizcdrqjsd\",\"name\":\"ydnfyhxdeoejz\",\"type\":\"cwif\"},{\"properties\":{\"subscriptionId\":\"tgzfbishcbkh\",\"displayName\":\"deyeamdphagalpbu\",\"provisioningState\":\"Failed\",\"acceptOwnershipUrl\":\"pwhonowkg\",\"acceptOwnershipState\":\"Pending\",\"billingScope\":\"nkixzbinj\",\"workload\":\"DevTest\",\"resellerId\":\"tmryw\",\"subscriptionOwnerId\":\"zoqftiyqzrnkcqvy\",\"managementGroupId\":\"whzlsicohoq\",\"createdTime\":\"wvl\",\"tags\":{\"konocu\":\"vwhheunmmqhgyx\",\"zf\":\"oklyaxuconuq\",\"vjektcxsenh\":\"beypewrmjmw\"}},\"id\":\"rsffrzpwvlqdqgbi\",\"name\":\"ylihkaetckt\",\"type\":\"fcivfsnkym\"},{\"properties\":{\"subscriptionId\":\"qhjfbebr\",\"displayName\":\"xerf\",\"provisioningState\":\"Accepted\",\"acceptOwnershipUrl\":\"ttxfvjr\",\"acceptOwnershipState\":\"Completed\",\"billingScope\":\"hxepcyvahfnlj\",\"workload\":\"Production\",\"resellerId\":\"j\",\"subscriptionOwnerId\":\"ujqgidok\",\"managementGroupId\":\"ljyoxgvcltb\",\"createdTime\":\"ncghkje\",\"tags\":{\"smx\":\"hbijhtxfvgxb\",\"pvecxgodeb\":\"eh\",\"pukgriwflzlfb\":\"qkkrb\"}},\"id\":\"puz\",\"name\":\"cispnqzahmgkbr\",\"type\":\"yydhibnuqqk\"},{\"properties\":{\"subscriptionId\":\"a\",\"displayName\":\"gvtqagnbuynh\",\"provisioningState\":\"Failed\",\"acceptOwnershipUrl\":\"mebf\",\"acceptOwnershipState\":\"Pending\",\"billingScope\":\"butr\",\"workload\":\"Production\",\"resellerId\":\"azzmhjrunmpxt\",\"subscriptionOwnerId\":\"bh\",\"managementGroupId\":\"nlankxmyskpb\",\"createdTime\":\"nbtkcxywnytnr\",\"tags\":{\"czfc\":\"lqidyby\",\"rqlfktsthsucocmn\":\"haaxdbabphl\",\"ckzywbiexzfeyue\":\"yazttbtwwrqpue\"}},\"id\":\"ibx\",\"name\":\"jwbhqwalmuz\",\"type\":\"oxaepd\"}],\"nextLink\":\"jancu\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SubscriptionManager manager = SubscriptionManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PutAliasListResult response = manager.alias().listWithResponse(com.azure.core.util.Context.NONE).getValue(); + SubscriptionAliasListResult response + = manager.alias().listWithResponse(com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/BillingAccountPoliciesResponseInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/BillingAccountPoliciesResponseInnerTests.java new file mode 100644 index 000000000000..fc1b7f71a9fc --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/BillingAccountPoliciesResponseInnerTests.java @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.fluent.models.BillingAccountPoliciesResponseInner; +import com.azure.resourcemanager.subscription.models.BillingAccountPoliciesResponseProperties; +import com.azure.resourcemanager.subscription.models.ServiceTenantResponse; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class BillingAccountPoliciesResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BillingAccountPoliciesResponseInner model = BinaryData.fromString( + "{\"properties\":{\"serviceTenants\":[{\"tenantId\":\"dntwndeicbtw\",\"tenantName\":\"zao\"},{\"tenantId\":\"uhrhcffcyddgl\",\"tenantName\":\"t\"}],\"allowTransfers\":true},\"id\":\"wpyeicxmqciwqvh\",\"name\":\"hix\",\"type\":\"igdtopbob\"}") + .toObject(BillingAccountPoliciesResponseInner.class); + Assertions.assertEquals("dntwndeicbtw", model.properties().serviceTenants().get(0).tenantId()); + Assertions.assertEquals("zao", model.properties().serviceTenants().get(0).tenantName()); + Assertions.assertTrue(model.properties().allowTransfers()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BillingAccountPoliciesResponseInner model + = new BillingAccountPoliciesResponseInner().withProperties(new BillingAccountPoliciesResponseProperties() + .withServiceTenants( + Arrays.asList(new ServiceTenantResponse().withTenantId("dntwndeicbtw").withTenantName("zao"), + new ServiceTenantResponse().withTenantId("uhrhcffcyddgl").withTenantName("t"))) + .withAllowTransfers(true)); + model = BinaryData.fromObject(model).toObject(BillingAccountPoliciesResponseInner.class); + Assertions.assertEquals("dntwndeicbtw", model.properties().serviceTenants().get(0).tenantId()); + Assertions.assertEquals("zao", model.properties().serviceTenants().get(0).tenantName()); + Assertions.assertTrue(model.properties().allowTransfers()); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/BillingAccountPoliciesResponsePropertiesTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/BillingAccountPoliciesResponsePropertiesTests.java new file mode 100644 index 000000000000..a2f81c8a6dd9 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/BillingAccountPoliciesResponsePropertiesTests.java @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.BillingAccountPoliciesResponseProperties; +import com.azure.resourcemanager.subscription.models.ServiceTenantResponse; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class BillingAccountPoliciesResponsePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + BillingAccountPoliciesResponseProperties model = BinaryData.fromString( + "{\"serviceTenants\":[{\"tenantId\":\"m\",\"tenantName\":\"u\"},{\"tenantId\":\"a\",\"tenantName\":\"rzayv\"}],\"allowTransfers\":false}") + .toObject(BillingAccountPoliciesResponseProperties.class); + Assertions.assertEquals("m", model.serviceTenants().get(0).tenantId()); + Assertions.assertEquals("u", model.serviceTenants().get(0).tenantName()); + Assertions.assertFalse(model.allowTransfers()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + BillingAccountPoliciesResponseProperties model + = new BillingAccountPoliciesResponseProperties() + .withServiceTenants(Arrays.asList(new ServiceTenantResponse().withTenantId("m").withTenantName("u"), + new ServiceTenantResponse().withTenantId("a").withTenantName("rzayv"))) + .withAllowTransfers(false); + model = BinaryData.fromObject(model).toObject(BillingAccountPoliciesResponseProperties.class); + Assertions.assertEquals("m", model.serviceTenants().get(0).tenantId()); + Assertions.assertEquals("u", model.serviceTenants().get(0).tenantName()); + Assertions.assertFalse(model.allowTransfers()); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/BillingAccountsGetPolicyWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/BillingAccountsGetPolicyWithResponseMockTests.java new file mode 100644 index 000000000000..15dedf40bb2d --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/BillingAccountsGetPolicyWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.SubscriptionManager; +import com.azure.resourcemanager.subscription.models.BillingAccountPoliciesResponse; +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 BillingAccountsGetPolicyWithResponseMockTests { + @Test + public void testGetPolicyWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"serviceTenants\":[{\"tenantId\":\"hsmtxpsiebtfhvp\",\"tenantName\":\"apskrdqm\"},{\"tenantId\":\"jdhtldwkyzxu\",\"tenantName\":\"kn\"},{\"tenantId\":\"scwsv\",\"tenantName\":\"otogtwrupqs\"}],\"allowTransfers\":false},\"id\":\"i\",\"name\":\"ykvceoveil\",\"type\":\"vnotyfjfcnj\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SubscriptionManager manager = SubscriptionManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + BillingAccountPoliciesResponse response = manager.billingAccounts() + .getPolicyWithResponse("baumnyqupedeoj", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("hsmtxpsiebtfhvp", response.properties().serviceTenants().get(0).tenantId()); + Assertions.assertEquals("apskrdqm", response.properties().serviceTenants().get(0).tenantName()); + Assertions.assertFalse(response.properties().allowTransfers()); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/CanceledSubscriptionIdInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/CanceledSubscriptionIdInnerTests.java index fc7753b780df..d4a2bdb5efb0 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/CanceledSubscriptionIdInnerTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/CanceledSubscriptionIdInnerTests.java @@ -11,7 +11,7 @@ public final class CanceledSubscriptionIdInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { CanceledSubscriptionIdInner model - = BinaryData.fromString("{\"subscriptionId\":\"xth\"}").toObject(CanceledSubscriptionIdInner.class); + = BinaryData.fromString("{\"subscriptionId\":\"mhquvgjxp\"}").toObject(CanceledSubscriptionIdInner.class); } @org.junit.jupiter.api.Test diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/EnabledSubscriptionIdInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/EnabledSubscriptionIdInnerTests.java index 1dca36d03d39..f288b143f4b3 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/EnabledSubscriptionIdInnerTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/EnabledSubscriptionIdInnerTests.java @@ -10,8 +10,8 @@ public final class EnabledSubscriptionIdInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - EnabledSubscriptionIdInner model = BinaryData.fromString("{\"subscriptionId\":\"fygxgispemvtzfk\"}") - .toObject(EnabledSubscriptionIdInner.class); + EnabledSubscriptionIdInner model + = BinaryData.fromString("{\"subscriptionId\":\"sybbejhph\"}").toObject(EnabledSubscriptionIdInner.class); } @org.junit.jupiter.api.Test diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/GetTenantPolicyListResponseTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/GetTenantPolicyListResponseTests.java new file mode 100644 index 000000000000..8449d1981848 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/GetTenantPolicyListResponseTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.GetTenantPolicyListResponse; + +public final class GetTenantPolicyListResponseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GetTenantPolicyListResponse model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"policyId\":\"qp\",\"blockSubscriptionsLeavingTenant\":true,\"blockSubscriptionsIntoTenant\":true,\"exemptedPrincipals\":[\"2b95eae0-4f72-4415-8670-7eafa754eca1\",\"aa241099-ea8c-412c-950c-0a19bcdfd64f\",\"edffc2d8-e98d-4083-b58d-ce32dc97fed0\"]},\"id\":\"pimexgstxgcpodg\",\"name\":\"aajrm\",\"type\":\"djwzrlov\"},{\"properties\":{\"policyId\":\"whijcoejctbza\",\"blockSubscriptionsLeavingTenant\":true,\"blockSubscriptionsIntoTenant\":false,\"exemptedPrincipals\":[\"9b259564-6bc1-4d45-8c15-53935445a00b\",\"4a7d196e-1c00-4d40-b1e0-741e384bd788\",\"68103724-7e6f-4f87-a0c5-4bdfce25d21d\"]},\"id\":\"bfkgukdkex\",\"name\":\"ppofmxaxcfjpgdd\",\"type\":\"ocjjxhvpmouexh\"}],\"nextLink\":\"xibqeojnx\"}") + .toObject(GetTenantPolicyListResponse.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GetTenantPolicyListResponse model = new GetTenantPolicyListResponse(); + model = BinaryData.fromObject(model).toObject(GetTenantPolicyListResponse.class); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/GetTenantPolicyResponseInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/GetTenantPolicyResponseInnerTests.java new file mode 100644 index 000000000000..c1ba26fcdc29 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/GetTenantPolicyResponseInnerTests.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.fluent.models.GetTenantPolicyResponseInner; +import com.azure.resourcemanager.subscription.models.TenantPolicy; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class GetTenantPolicyResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + GetTenantPolicyResponseInner model = BinaryData.fromString( + "{\"properties\":{\"policyId\":\"rlkhbzhfepgzgq\",\"blockSubscriptionsLeavingTenant\":false,\"blockSubscriptionsIntoTenant\":true,\"exemptedPrincipals\":[\"faa5569a-344c-499a-9038-62aefecd133c\",\"fec1e915-abaa-4928-88c9-54a9753b0ee7\",\"b7bcbf80-dfdb-48a4-9820-9f9bf99ccde9\"]},\"id\":\"c\",\"name\":\"aierhhb\",\"type\":\"sglumma\"}") + .toObject(GetTenantPolicyResponseInner.class); + Assertions.assertFalse(model.properties().blockSubscriptionsLeavingTenant()); + Assertions.assertTrue(model.properties().blockSubscriptionsIntoTenant()); + Assertions.assertEquals(UUID.fromString("faa5569a-344c-499a-9038-62aefecd133c"), + model.properties().exemptedPrincipals().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + GetTenantPolicyResponseInner model = new GetTenantPolicyResponseInner() + .withProperties(new TenantPolicy().withBlockSubscriptionsLeavingTenant(false) + .withBlockSubscriptionsIntoTenant(true) + .withExemptedPrincipals(Arrays.asList(UUID.fromString("faa5569a-344c-499a-9038-62aefecd133c"), + UUID.fromString("fec1e915-abaa-4928-88c9-54a9753b0ee7"), + UUID.fromString("b7bcbf80-dfdb-48a4-9820-9f9bf99ccde9")))); + model = BinaryData.fromObject(model).toObject(GetTenantPolicyResponseInner.class); + Assertions.assertFalse(model.properties().blockSubscriptionsLeavingTenant()); + Assertions.assertTrue(model.properties().blockSubscriptionsIntoTenant()); + Assertions.assertEquals(UUID.fromString("faa5569a-344c-499a-9038-62aefecd133c"), + model.properties().exemptedPrincipals().get(0)); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/LocationInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/LocationInnerTests.java deleted file mode 100644 index 65b1c1b686d7..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/LocationInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.subscription.fluent.models.LocationInner; - -public final class LocationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LocationInner model = BinaryData.fromString( - "{\"id\":\"pewnw\",\"subscriptionId\":\"itjz\",\"name\":\"lusarh\",\"displayName\":\"fcqhsmyurkd\",\"latitude\":\"lx\",\"longitude\":\"kuksjtxukcdm\"}") - .toObject(LocationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LocationInner model = new LocationInner(); - model = BinaryData.fromObject(model).toObject(LocationInner.class); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/LocationListResultTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/LocationListResultTests.java deleted file mode 100644 index 8c888458e351..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/LocationListResultTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.subscription.fluent.models.LocationInner; -import com.azure.resourcemanager.subscription.models.LocationListResult; -import java.util.Arrays; - -public final class LocationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - LocationListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"quvgjxpybczme\",\"subscriptionId\":\"tzopbsphrupidgsy\",\"name\":\"ejhphoyc\",\"displayName\":\"xaobhdxbmtqioqjz\",\"latitude\":\"tbmufpo\",\"longitude\":\"oizh\"},{\"id\":\"rxybqsoq\",\"subscriptionId\":\"gkdmb\",\"name\":\"zlobcufpd\",\"displayName\":\"rbt\",\"latitude\":\"qjnqglhqgnufoooj\",\"longitude\":\"ifsqesaagdfmg\"},{\"id\":\"lhjxr\",\"subscriptionId\":\"kwm\",\"name\":\"ktsizntocipaou\",\"displayName\":\"psqucmpoyf\",\"latitude\":\"fogknygjofjdde\",\"longitude\":\"rd\"}]}") - .toObject(LocationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - LocationListResult model = new LocationListResult() - .withValue(Arrays.asList(new LocationInner(), new LocationInner(), new LocationInner())); - model = BinaryData.fromObject(model).toObject(LocationListResult.class); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationDisplayTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationDisplayTests.java index ce6142786e6e..ccf13e3f44d6 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationDisplayTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationDisplayTests.java @@ -11,21 +11,25 @@ public final class OperationDisplayTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { - OperationDisplay model - = BinaryData.fromString("{\"provider\":\"ftyxolniw\",\"resource\":\"cukjf\",\"operation\":\"iawxklry\"}") - .toObject(OperationDisplay.class); - Assertions.assertEquals("ftyxolniw", model.provider()); - Assertions.assertEquals("cukjf", model.resource()); - Assertions.assertEquals("iawxklry", model.operation()); + OperationDisplay model = BinaryData.fromString( + "{\"provider\":\"ktsizntocipaou\",\"resource\":\"psqucmpoyf\",\"operation\":\"fogknygjofjdde\",\"description\":\"rd\"}") + .toObject(OperationDisplay.class); + Assertions.assertEquals("ktsizntocipaou", model.provider()); + Assertions.assertEquals("psqucmpoyf", model.resource()); + Assertions.assertEquals("fogknygjofjdde", model.operation()); + Assertions.assertEquals("rd", model.description()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - OperationDisplay model - = new OperationDisplay().withProvider("ftyxolniw").withResource("cukjf").withOperation("iawxklry"); + OperationDisplay model = new OperationDisplay().withProvider("ktsizntocipaou") + .withResource("psqucmpoyf") + .withOperation("fogknygjofjdde") + .withDescription("rd"); model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - Assertions.assertEquals("ftyxolniw", model.provider()); - Assertions.assertEquals("cukjf", model.resource()); - Assertions.assertEquals("iawxklry", model.operation()); + Assertions.assertEquals("ktsizntocipaou", model.provider()); + Assertions.assertEquals("psqucmpoyf", model.resource()); + Assertions.assertEquals("fogknygjofjdde", model.operation()); + Assertions.assertEquals("rd", model.description()); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationInnerTests.java new file mode 100644 index 000000000000..0930948726d7 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationInnerTests.java @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.fluent.models.OperationInner; +import com.azure.resourcemanager.subscription.models.OperationDisplay; +import org.junit.jupiter.api.Assertions; + +public final class OperationInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationInner model = BinaryData.fromString( + "{\"name\":\"pdznrbtcqqjnqgl\",\"isDataAction\":false,\"display\":{\"provider\":\"foooj\",\"resource\":\"ifsqesaagdfmg\",\"operation\":\"lhjxr\",\"description\":\"kwm\"}}") + .toObject(OperationInner.class); + Assertions.assertEquals("pdznrbtcqqjnqgl", model.name()); + Assertions.assertFalse(model.isDataAction()); + Assertions.assertEquals("foooj", model.display().provider()); + Assertions.assertEquals("ifsqesaagdfmg", model.display().resource()); + Assertions.assertEquals("lhjxr", model.display().operation()); + Assertions.assertEquals("kwm", model.display().description()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationInner model = new OperationInner().withName("pdznrbtcqqjnqgl") + .withIsDataAction(false) + .withDisplay(new OperationDisplay().withProvider("foooj") + .withResource("ifsqesaagdfmg") + .withOperation("lhjxr") + .withDescription("kwm")); + model = BinaryData.fromObject(model).toObject(OperationInner.class); + Assertions.assertEquals("pdznrbtcqqjnqgl", model.name()); + Assertions.assertFalse(model.isDataAction()); + Assertions.assertEquals("foooj", model.display().provider()); + Assertions.assertEquals("ifsqesaagdfmg", model.display().resource()); + Assertions.assertEquals("lhjxr", model.display().operation()); + Assertions.assertEquals("kwm", model.display().description()); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationListResultInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationListResultInnerTests.java deleted file mode 100644 index 8bdcb2d98832..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationListResultInnerTests.java +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.subscription.fluent.models.OperationListResultInner; -import com.azure.resourcemanager.subscription.models.Operation; -import com.azure.resourcemanager.subscription.models.OperationDisplay; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class OperationListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResultInner model = BinaryData.fromString( - "{\"value\":[{\"name\":\"ljofxqeofjaeqjh\",\"display\":{\"provider\":\"asvm\",\"resource\":\"jqul\",\"operation\":\"sntnbybkzgcw\"}},{\"name\":\"clxxwrljdo\",\"display\":{\"provider\":\"cqvkocrcjdkwtn\",\"resource\":\"bnjbiksqrglssain\",\"operation\":\"jwnzlljfmp\"}},{\"name\":\"ebvmgxsabkyqd\",\"display\":{\"provider\":\"itcjczdz\",\"resource\":\"ndhkrw\",\"operation\":\"appd\"}}],\"nextLink\":\"dkvwrwjfe\"}") - .toObject(OperationListResultInner.class); - Assertions.assertEquals("ljofxqeofjaeqjh", model.value().get(0).name()); - Assertions.assertEquals("asvm", model.value().get(0).display().provider()); - Assertions.assertEquals("jqul", model.value().get(0).display().resource()); - Assertions.assertEquals("sntnbybkzgcw", model.value().get(0).display().operation()); - Assertions.assertEquals("dkvwrwjfe", model.nextLink()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResultInner model = new OperationListResultInner() - .withValue(Arrays.asList( - new Operation().withName("ljofxqeofjaeqjh") - .withDisplay( - new OperationDisplay().withProvider("asvm").withResource("jqul").withOperation("sntnbybkzgcw")), - new Operation().withName("clxxwrljdo") - .withDisplay(new OperationDisplay().withProvider("cqvkocrcjdkwtn") - .withResource("bnjbiksqrglssain") - .withOperation("jwnzlljfmp")), - new Operation().withName("ebvmgxsabkyqd") - .withDisplay( - new OperationDisplay().withProvider("itcjczdz").withResource("ndhkrw").withOperation("appd")))) - .withNextLink("dkvwrwjfe"); - model = BinaryData.fromObject(model).toObject(OperationListResultInner.class); - Assertions.assertEquals("ljofxqeofjaeqjh", model.value().get(0).name()); - Assertions.assertEquals("asvm", model.value().get(0).display().provider()); - Assertions.assertEquals("jqul", model.value().get(0).display().resource()); - Assertions.assertEquals("sntnbybkzgcw", model.value().get(0).display().operation()); - Assertions.assertEquals("dkvwrwjfe", model.nextLink()); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationListResultTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationListResultTests.java new file mode 100644 index 000000000000..f100e8dcb77e --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationListResultTests.java @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.fluent.models.OperationInner; +import com.azure.resourcemanager.subscription.models.OperationDisplay; +import com.azure.resourcemanager.subscription.models.OperationListResult; +import java.util.Arrays; +import org.junit.jupiter.api.Assertions; + +public final class OperationListResultTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + OperationListResult model = BinaryData.fromString( + "{\"value\":[{\"name\":\"qj\",\"isDataAction\":false,\"display\":{\"provider\":\"muf\",\"resource\":\"wnoi\",\"operation\":\"wlrxyb\",\"description\":\"oqijgkdmbpaz\"}}],\"nextLink\":\"bc\"}") + .toObject(OperationListResult.class); + Assertions.assertEquals("qj", model.value().get(0).name()); + Assertions.assertFalse(model.value().get(0).isDataAction()); + Assertions.assertEquals("muf", model.value().get(0).display().provider()); + Assertions.assertEquals("wnoi", model.value().get(0).display().resource()); + Assertions.assertEquals("wlrxyb", model.value().get(0).display().operation()); + Assertions.assertEquals("oqijgkdmbpaz", model.value().get(0).display().description()); + Assertions.assertEquals("bc", model.nextLink()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + OperationListResult model + = new OperationListResult().withValue(Arrays.asList(new OperationInner().withName("qj") + .withIsDataAction(false) + .withDisplay(new OperationDisplay().withProvider("muf") + .withResource("wnoi") + .withOperation("wlrxyb") + .withDescription("oqijgkdmbpaz")))) + .withNextLink("bc"); + model = BinaryData.fromObject(model).toObject(OperationListResult.class); + Assertions.assertEquals("qj", model.value().get(0).name()); + Assertions.assertFalse(model.value().get(0).isDataAction()); + Assertions.assertEquals("muf", model.value().get(0).display().provider()); + Assertions.assertEquals("wnoi", model.value().get(0).display().resource()); + Assertions.assertEquals("wlrxyb", model.value().get(0).display().operation()); + Assertions.assertEquals("oqijgkdmbpaz", model.value().get(0).display().description()); + Assertions.assertEquals("bc", model.nextLink()); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationTests.java deleted file mode 100644 index 4c54e5d958f6..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.subscription.models.Operation; -import com.azure.resourcemanager.subscription.models.OperationDisplay; -import org.junit.jupiter.api.Assertions; - -public final class OperationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Operation model = BinaryData.fromString( - "{\"name\":\"nhutjeltmrldhugj\",\"display\":{\"provider\":\"atqxho\",\"resource\":\"geablgphuticndvk\",\"operation\":\"zwyiftyhxhur\"}}") - .toObject(Operation.class); - Assertions.assertEquals("nhutjeltmrldhugj", model.name()); - Assertions.assertEquals("atqxho", model.display().provider()); - Assertions.assertEquals("geablgphuticndvk", model.display().resource()); - Assertions.assertEquals("zwyiftyhxhur", model.display().operation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Operation model = new Operation().withName("nhutjeltmrldhugj") - .withDisplay(new OperationDisplay().withProvider("atqxho") - .withResource("geablgphuticndvk") - .withOperation("zwyiftyhxhur")); - model = BinaryData.fromObject(model).toObject(Operation.class); - Assertions.assertEquals("nhutjeltmrldhugj", model.name()); - Assertions.assertEquals("atqxho", model.display().provider()); - Assertions.assertEquals("geablgphuticndvk", model.display().resource()); - Assertions.assertEquals("zwyiftyhxhur", model.display().operation()); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationsListMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationsListMockTests.java new file mode 100644 index 000000000000..9d236d011483 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationsListMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.SubscriptionManager; +import com.azure.resourcemanager.subscription.models.Operation; +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 OperationsListMockTests { + @Test + public void testList() throws Exception { + String responseStr + = "{\"value\":[{\"name\":\"djpjumasxazjpq\",\"isDataAction\":false,\"display\":{\"provider\":\"lhbxxhejjzzvdud\",\"resource\":\"dslfhotwmcy\",\"operation\":\"wlbjnpgacftade\",\"description\":\"nltyfsoppusuesnz\"}}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SubscriptionManager manager = SubscriptionManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); + + Assertions.assertEquals("djpjumasxazjpq", response.iterator().next().name()); + Assertions.assertFalse(response.iterator().next().isDataAction()); + Assertions.assertEquals("lhbxxhejjzzvdud", response.iterator().next().display().provider()); + Assertions.assertEquals("dslfhotwmcy", response.iterator().next().display().resource()); + Assertions.assertEquals("wlbjnpgacftade", response.iterator().next().display().operation()); + Assertions.assertEquals("nltyfsoppusuesnz", response.iterator().next().display().description()); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationsListWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationsListWithResponseMockTests.java deleted file mode 100644 index e27cccc19387..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/OperationsListWithResponseMockTests.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.subscription.SubscriptionManager; -import com.azure.resourcemanager.subscription.models.OperationListResult; -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 OperationsListWithResponseMockTests { - @Test - public void testListWithResponse() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"rhcffcydd\",\"display\":{\"provider\":\"jthjqkwpyei\",\"resource\":\"mqc\",\"operation\":\"q\"}},{\"name\":\"khixuigdtopbo\",\"display\":{\"provider\":\"ghmewuam\",\"resource\":\"hrzayvvtpgvdf\",\"operation\":\"otkftutqxlngx\"}},{\"name\":\"fgugnxkrxdqmid\",\"display\":{\"provider\":\"zrvqdr\",\"resource\":\"hjybigehoqfbo\",\"operation\":\"kanyktzlcuiywg\"}},{\"name\":\"wgndrvynhzgpp\",\"display\":{\"provider\":\"gyncocpecfvmmc\",\"resource\":\"fsxlzevgbmqjqa\",\"operation\":\"y\"}}],\"nextLink\":\"ivkwlzuvccfwnfnb\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - SubscriptionManager manager = SubscriptionManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - OperationListResult response - = manager.operations().listWithResponse(com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("rhcffcydd", response.value().get(0).name()); - Assertions.assertEquals("jthjqkwpyei", response.value().get(0).display().provider()); - Assertions.assertEquals("mqc", response.value().get(0).display().resource()); - Assertions.assertEquals("q", response.value().get(0).display().operation()); - Assertions.assertEquals("ivkwlzuvccfwnfnb", response.nextLink()); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasListResultInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasListResultInnerTests.java deleted file mode 100644 index 1470c3b4b69d..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasListResultInnerTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasListResultInner; - -public final class PutAliasListResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PutAliasListResultInner model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"subscriptionId\":\"qux\",\"provisioningState\":\"Succeeded\"},\"id\":\"yjgzjaoyfhrtxiln\",\"name\":\"rkujy\",\"type\":\"vlejuvfqa\"},{\"properties\":{\"subscriptionId\":\"yxwjkcp\",\"provisioningState\":\"Failed\"},\"id\":\"wbxgjvt\",\"name\":\"vpys\",\"type\":\"zdn\"}],\"nextLink\":\"jq\"}") - .toObject(PutAliasListResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PutAliasListResultInner model = new PutAliasListResultInner(); - model = BinaryData.fromObject(model).toObject(PutAliasListResultInner.class); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestAdditionalPropertiesTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestAdditionalPropertiesTests.java new file mode 100644 index 000000000000..b2171a0a57df --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestAdditionalPropertiesTests.java @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.PutAliasRequestAdditionalProperties; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class PutAliasRequestAdditionalPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PutAliasRequestAdditionalProperties model = BinaryData.fromString( + "{\"managementGroupId\":\"wvukx\",\"subscriptionTenantId\":\"udccsnhsjc\",\"subscriptionOwnerId\":\"ejhkry\",\"tags\":{\"lokjyemkk\":\"apcz\",\"joxzjnchgejspodm\":\"ni\",\"h\":\"ilzyd\"}}") + .toObject(PutAliasRequestAdditionalProperties.class); + Assertions.assertEquals("wvukx", model.managementGroupId()); + Assertions.assertEquals("udccsnhsjc", model.subscriptionTenantId()); + Assertions.assertEquals("ejhkry", model.subscriptionOwnerId()); + Assertions.assertEquals("apcz", model.tags().get("lokjyemkk")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PutAliasRequestAdditionalProperties model + = new PutAliasRequestAdditionalProperties().withManagementGroupId("wvukx") + .withSubscriptionTenantId("udccsnhsjc") + .withSubscriptionOwnerId("ejhkry") + .withTags(mapOf("lokjyemkk", "apcz", "joxzjnchgejspodm", "ni", "h", "ilzyd")); + model = BinaryData.fromObject(model).toObject(PutAliasRequestAdditionalProperties.class); + Assertions.assertEquals("wvukx", model.managementGroupId()); + Assertions.assertEquals("udccsnhsjc", model.subscriptionTenantId()); + Assertions.assertEquals("ejhkry", model.subscriptionOwnerId()); + Assertions.assertEquals("apcz", model.tags().get("lokjyemkk")); + } + + // 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/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestPropertiesTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestPropertiesTests.java index e28d914e45f7..559f4b4fb6f6 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestPropertiesTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestPropertiesTests.java @@ -5,35 +5,62 @@ package com.azure.resourcemanager.subscription.generated; import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.PutAliasRequestAdditionalProperties; import com.azure.resourcemanager.subscription.models.PutAliasRequestProperties; import com.azure.resourcemanager.subscription.models.Workload; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Assertions; public final class PutAliasRequestPropertiesTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PutAliasRequestProperties model = BinaryData.fromString( - "{\"displayName\":\"akeqs\",\"workload\":\"Production\",\"billingScope\":\"zqqedq\",\"subscriptionId\":\"bciqfouflm\",\"resellerId\":\"kzsmodm\"}") + "{\"displayName\":\"nryrtihf\",\"workload\":\"DevTest\",\"billingScope\":\"bpzvgn\",\"subscriptionId\":\"symglzufcyz\",\"resellerId\":\"hdbihan\",\"additionalProperties\":{\"managementGroupId\":\"fcbjysagithxqha\",\"subscriptionTenantId\":\"fpikxwczb\",\"subscriptionOwnerId\":\"cnpqxuhivyqniwby\",\"tags\":{\"mjgr\":\"xvd\"}}}") .toObject(PutAliasRequestProperties.class); - Assertions.assertEquals("akeqs", model.displayName()); - Assertions.assertEquals(Workload.PRODUCTION, model.workload()); - Assertions.assertEquals("zqqedq", model.billingScope()); - Assertions.assertEquals("bciqfouflm", model.subscriptionId()); - Assertions.assertEquals("kzsmodm", model.resellerId()); + Assertions.assertEquals("nryrtihf", model.displayName()); + Assertions.assertEquals(Workload.DEV_TEST, model.workload()); + Assertions.assertEquals("bpzvgn", model.billingScope()); + Assertions.assertEquals("symglzufcyz", model.subscriptionId()); + Assertions.assertEquals("hdbihan", model.resellerId()); + Assertions.assertEquals("fcbjysagithxqha", model.additionalProperties().managementGroupId()); + Assertions.assertEquals("fpikxwczb", model.additionalProperties().subscriptionTenantId()); + Assertions.assertEquals("cnpqxuhivyqniwby", model.additionalProperties().subscriptionOwnerId()); + Assertions.assertEquals("xvd", model.additionalProperties().tags().get("mjgr")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - PutAliasRequestProperties model = new PutAliasRequestProperties().withDisplayName("akeqs") - .withWorkload(Workload.PRODUCTION) - .withBillingScope("zqqedq") - .withSubscriptionId("bciqfouflm") - .withResellerId("kzsmodm"); + PutAliasRequestProperties model = new PutAliasRequestProperties().withDisplayName("nryrtihf") + .withWorkload(Workload.DEV_TEST) + .withBillingScope("bpzvgn") + .withSubscriptionId("symglzufcyz") + .withResellerId("hdbihan") + .withAdditionalProperties(new PutAliasRequestAdditionalProperties().withManagementGroupId("fcbjysagithxqha") + .withSubscriptionTenantId("fpikxwczb") + .withSubscriptionOwnerId("cnpqxuhivyqniwby") + .withTags(mapOf("mjgr", "xvd"))); model = BinaryData.fromObject(model).toObject(PutAliasRequestProperties.class); - Assertions.assertEquals("akeqs", model.displayName()); - Assertions.assertEquals(Workload.PRODUCTION, model.workload()); - Assertions.assertEquals("zqqedq", model.billingScope()); - Assertions.assertEquals("bciqfouflm", model.subscriptionId()); - Assertions.assertEquals("kzsmodm", model.resellerId()); + Assertions.assertEquals("nryrtihf", model.displayName()); + Assertions.assertEquals(Workload.DEV_TEST, model.workload()); + Assertions.assertEquals("bpzvgn", model.billingScope()); + Assertions.assertEquals("symglzufcyz", model.subscriptionId()); + Assertions.assertEquals("hdbihan", model.resellerId()); + Assertions.assertEquals("fcbjysagithxqha", model.additionalProperties().managementGroupId()); + Assertions.assertEquals("fpikxwczb", model.additionalProperties().subscriptionTenantId()); + Assertions.assertEquals("cnpqxuhivyqniwby", model.additionalProperties().subscriptionOwnerId()); + Assertions.assertEquals("xvd", model.additionalProperties().tags().get("mjgr")); + } + + // 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/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestTests.java index 8d243d5eb163..104efc9ebf6f 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasRequestTests.java @@ -6,36 +6,63 @@ import com.azure.core.util.BinaryData; import com.azure.resourcemanager.subscription.models.PutAliasRequest; +import com.azure.resourcemanager.subscription.models.PutAliasRequestAdditionalProperties; import com.azure.resourcemanager.subscription.models.PutAliasRequestProperties; import com.azure.resourcemanager.subscription.models.Workload; +import java.util.HashMap; +import java.util.Map; import org.junit.jupiter.api.Assertions; public final class PutAliasRequestTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { PutAliasRequest model = BinaryData.fromString( - "{\"properties\":{\"displayName\":\"wckbasyypnd\",\"workload\":\"Production\",\"billingScope\":\"cbacphejkotynqg\",\"subscriptionId\":\"l\",\"resellerId\":\"dlikwyqkgfgibma\"}}") + "{\"properties\":{\"displayName\":\"ewnwreitjzyfl\",\"workload\":\"DevTest\",\"billingScope\":\"hmofc\",\"subscriptionId\":\"smy\",\"resellerId\":\"kdtmlxhekuk\",\"additionalProperties\":{\"managementGroupId\":\"xukcdmpar\",\"subscriptionTenantId\":\"y\",\"subscriptionOwnerId\":\"nzwuxzd\",\"tags\":{\"u\":\"yrlhmwhfpmrqobm\"}}}}") .toObject(PutAliasRequest.class); - Assertions.assertEquals("wckbasyypnd", model.properties().displayName()); - Assertions.assertEquals(Workload.PRODUCTION, model.properties().workload()); - Assertions.assertEquals("cbacphejkotynqg", model.properties().billingScope()); - Assertions.assertEquals("l", model.properties().subscriptionId()); - Assertions.assertEquals("dlikwyqkgfgibma", model.properties().resellerId()); + Assertions.assertEquals("ewnwreitjzyfl", model.properties().displayName()); + Assertions.assertEquals(Workload.DEV_TEST, model.properties().workload()); + Assertions.assertEquals("hmofc", model.properties().billingScope()); + Assertions.assertEquals("smy", model.properties().subscriptionId()); + Assertions.assertEquals("kdtmlxhekuk", model.properties().resellerId()); + Assertions.assertEquals("xukcdmpar", model.properties().additionalProperties().managementGroupId()); + Assertions.assertEquals("y", model.properties().additionalProperties().subscriptionTenantId()); + Assertions.assertEquals("nzwuxzd", model.properties().additionalProperties().subscriptionOwnerId()); + Assertions.assertEquals("yrlhmwhfpmrqobm", model.properties().additionalProperties().tags().get("u")); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { PutAliasRequest model - = new PutAliasRequest().withProperties(new PutAliasRequestProperties().withDisplayName("wckbasyypnd") - .withWorkload(Workload.PRODUCTION) - .withBillingScope("cbacphejkotynqg") - .withSubscriptionId("l") - .withResellerId("dlikwyqkgfgibma")); + = new PutAliasRequest().withProperties(new PutAliasRequestProperties().withDisplayName("ewnwreitjzyfl") + .withWorkload(Workload.DEV_TEST) + .withBillingScope("hmofc") + .withSubscriptionId("smy") + .withResellerId("kdtmlxhekuk") + .withAdditionalProperties(new PutAliasRequestAdditionalProperties().withManagementGroupId("xukcdmpar") + .withSubscriptionTenantId("y") + .withSubscriptionOwnerId("nzwuxzd") + .withTags(mapOf("u", "yrlhmwhfpmrqobm")))); model = BinaryData.fromObject(model).toObject(PutAliasRequest.class); - Assertions.assertEquals("wckbasyypnd", model.properties().displayName()); - Assertions.assertEquals(Workload.PRODUCTION, model.properties().workload()); - Assertions.assertEquals("cbacphejkotynqg", model.properties().billingScope()); - Assertions.assertEquals("l", model.properties().subscriptionId()); - Assertions.assertEquals("dlikwyqkgfgibma", model.properties().resellerId()); + Assertions.assertEquals("ewnwreitjzyfl", model.properties().displayName()); + Assertions.assertEquals(Workload.DEV_TEST, model.properties().workload()); + Assertions.assertEquals("hmofc", model.properties().billingScope()); + Assertions.assertEquals("smy", model.properties().subscriptionId()); + Assertions.assertEquals("kdtmlxhekuk", model.properties().resellerId()); + Assertions.assertEquals("xukcdmpar", model.properties().additionalProperties().managementGroupId()); + Assertions.assertEquals("y", model.properties().additionalProperties().subscriptionTenantId()); + Assertions.assertEquals("nzwuxzd", model.properties().additionalProperties().subscriptionOwnerId()); + Assertions.assertEquals("yrlhmwhfpmrqobm", model.properties().additionalProperties().tags().get("u")); + } + + // 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/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasResponseInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasResponseInnerTests.java deleted file mode 100644 index d4dcfde8e465..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasResponseInnerTests.java +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.subscription.fluent.models.PutAliasResponseInner; -import com.azure.resourcemanager.subscription.models.ProvisioningState; -import com.azure.resourcemanager.subscription.models.PutAliasResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class PutAliasResponseInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PutAliasResponseInner model = BinaryData.fromString( - "{\"properties\":{\"subscriptionId\":\"ugpbkw\",\"provisioningState\":\"Succeeded\"},\"id\":\"tduqktapspwgcuer\",\"name\":\"umkdosvqwhbmd\",\"type\":\"bbjfddgmbmbexp\"}") - .toObject(PutAliasResponseInner.class); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.properties().provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PutAliasResponseInner model = new PutAliasResponseInner() - .withProperties(new PutAliasResponseProperties().withProvisioningState(ProvisioningState.SUCCEEDED)); - model = BinaryData.fromObject(model).toObject(PutAliasResponseInner.class); - Assertions.assertEquals(ProvisioningState.SUCCEEDED, model.properties().provisioningState()); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasResponsePropertiesTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasResponsePropertiesTests.java deleted file mode 100644 index 3483d03b2533..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutAliasResponsePropertiesTests.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.subscription.models.ProvisioningState; -import com.azure.resourcemanager.subscription.models.PutAliasResponseProperties; -import org.junit.jupiter.api.Assertions; - -public final class PutAliasResponsePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - PutAliasResponseProperties model - = BinaryData.fromString("{\"subscriptionId\":\"htqqrolfp\",\"provisioningState\":\"Failed\"}") - .toObject(PutAliasResponseProperties.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - PutAliasResponseProperties model - = new PutAliasResponseProperties().withProvisioningState(ProvisioningState.FAILED); - model = BinaryData.fromObject(model).toObject(PutAliasResponseProperties.class); - Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutTenantPolicyRequestPropertiesTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutTenantPolicyRequestPropertiesTests.java new file mode 100644 index 000000000000..8407504f3a65 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/PutTenantPolicyRequestPropertiesTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.PutTenantPolicyRequestProperties; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class PutTenantPolicyRequestPropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + PutTenantPolicyRequestProperties model = BinaryData.fromString( + "{\"blockSubscriptionsLeavingTenant\":false,\"blockSubscriptionsIntoTenant\":true,\"exemptedPrincipals\":[\"51f863b4-2638-467d-835b-0be19b493036\"]}") + .toObject(PutTenantPolicyRequestProperties.class); + Assertions.assertFalse(model.blockSubscriptionsLeavingTenant()); + Assertions.assertTrue(model.blockSubscriptionsIntoTenant()); + Assertions.assertEquals(UUID.fromString("51f863b4-2638-467d-835b-0be19b493036"), + model.exemptedPrincipals().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + PutTenantPolicyRequestProperties model + = new PutTenantPolicyRequestProperties().withBlockSubscriptionsLeavingTenant(false) + .withBlockSubscriptionsIntoTenant(true) + .withExemptedPrincipals(Arrays.asList(UUID.fromString("51f863b4-2638-467d-835b-0be19b493036"))); + model = BinaryData.fromObject(model).toObject(PutTenantPolicyRequestProperties.class); + Assertions.assertFalse(model.blockSubscriptionsLeavingTenant()); + Assertions.assertTrue(model.blockSubscriptionsIntoTenant()); + Assertions.assertEquals(UUID.fromString("51f863b4-2638-467d-835b-0be19b493036"), + model.exemptedPrincipals().get(0)); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/RenamedSubscriptionIdInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/RenamedSubscriptionIdInnerTests.java index eadd9175b958..485864d895fc 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/RenamedSubscriptionIdInnerTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/RenamedSubscriptionIdInnerTests.java @@ -11,7 +11,7 @@ public final class RenamedSubscriptionIdInnerTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { RenamedSubscriptionIdInner model - = BinaryData.fromString("{\"subscriptionId\":\"ngbwjz\"}").toObject(RenamedSubscriptionIdInner.class); + = BinaryData.fromString("{\"subscriptionId\":\"upi\"}").toObject(RenamedSubscriptionIdInner.class); } @org.junit.jupiter.api.Test diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/ServiceTenantResponseTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/ServiceTenantResponseTests.java new file mode 100644 index 000000000000..1f6f5d001f3d --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/ServiceTenantResponseTests.java @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.ServiceTenantResponse; +import org.junit.jupiter.api.Assertions; + +public final class ServiceTenantResponseTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + ServiceTenantResponse model = BinaryData.fromString("{\"tenantId\":\"vdfgiotk\",\"tenantName\":\"utqxlngx\"}") + .toObject(ServiceTenantResponse.class); + Assertions.assertEquals("vdfgiotk", model.tenantId()); + Assertions.assertEquals("utqxlngx", model.tenantName()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + ServiceTenantResponse model = new ServiceTenantResponse().withTenantId("vdfgiotk").withTenantName("utqxlngx"); + model = BinaryData.fromObject(model).toObject(ServiceTenantResponse.class); + Assertions.assertEquals("vdfgiotk", model.tenantId()); + Assertions.assertEquals("utqxlngx", model.tenantName()); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionAliasListResultInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionAliasListResultInnerTests.java new file mode 100644 index 000000000000..d1e9992ced31 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionAliasListResultInnerTests.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasListResultInner; + +public final class SubscriptionAliasListResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SubscriptionAliasListResultInner model = BinaryData.fromString( + "{\"value\":[{\"properties\":{\"subscriptionId\":\"gispemvtzfkufubl\",\"displayName\":\"fxqeof\",\"provisioningState\":\"Succeeded\",\"acceptOwnershipUrl\":\"jhqjbasvmsmjqul\",\"acceptOwnershipState\":\"Pending\",\"billingScope\":\"tnb\",\"workload\":\"DevTest\",\"resellerId\":\"gc\",\"subscriptionOwnerId\":\"wclxxwrl\",\"managementGroupId\":\"ouskcqvkocrc\",\"createdTime\":\"kwt\",\"tags\":{\"p\":\"bnjbiksqrglssain\",\"mgxsab\":\"wnzlljfmppeeb\",\"jczdzevndh\":\"yqduujit\"}},\"id\":\"wpdappdsbdkv\",\"name\":\"rwjfe\",\"type\":\"snhu\"},{\"properties\":{\"subscriptionId\":\"ltmrldh\",\"displayName\":\"jzzd\",\"provisioningState\":\"Accepted\",\"acceptOwnershipUrl\":\"hocdgeab\",\"acceptOwnershipState\":\"Expired\",\"billingScope\":\"uticndvkaozwyif\",\"workload\":\"Production\",\"resellerId\":\"hurokftyxoln\",\"subscriptionOwnerId\":\"pwcukjfkgiawxk\",\"managementGroupId\":\"ypl\",\"createdTime\":\"kbasyypn\",\"tags\":{\"hejkotynqgou\":\"sgcbac\",\"kgfg\":\"zndlikwy\",\"qsrxybzqqed\":\"bmadgak\",\"iqfouflmmnkz\":\"ytb\"}},\"id\":\"odmgl\",\"name\":\"ugpbkw\",\"type\":\"mutduqktaps\"},{\"properties\":{\"subscriptionId\":\"cuertu\",\"displayName\":\"dosvqwhbmdgbbjf\",\"provisioningState\":\"Accepted\",\"acceptOwnershipUrl\":\"bmbexppbhtqqro\",\"acceptOwnershipState\":\"Pending\",\"billingScope\":\"psalgbqux\",\"workload\":\"Production\",\"resellerId\":\"jgzjaoyfhrtx\",\"subscriptionOwnerId\":\"n\",\"managementGroupId\":\"kujysvlejuvfq\",\"createdTime\":\"rlyxwjkcprbnw\",\"tags\":{\"dnrujqguhmuouqfp\":\"jvtbvpyss\",\"uizga\":\"wzwbnguitn\"}},\"id\":\"ufizuckyf\",\"name\":\"hr\",\"type\":\"idf\"}],\"nextLink\":\"wdzuhtymwisd\"}") + .toObject(SubscriptionAliasListResultInner.class); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SubscriptionAliasListResultInner model = new SubscriptionAliasListResultInner(); + model = BinaryData.fromObject(model).toObject(SubscriptionAliasListResultInner.class); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionAliasResponseInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionAliasResponseInnerTests.java new file mode 100644 index 000000000000..c70974e1066a --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionAliasResponseInnerTests.java @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionAliasResponseInner; +import com.azure.resourcemanager.subscription.models.ProvisioningState; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasResponseProperties; +import com.azure.resourcemanager.subscription.models.Workload; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SubscriptionAliasResponseInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SubscriptionAliasResponseInner model = BinaryData.fromString( + "{\"properties\":{\"subscriptionId\":\"yahux\",\"displayName\":\"pmqnja\",\"provisioningState\":\"Failed\",\"acceptOwnershipUrl\":\"jsprozvcpute\",\"acceptOwnershipState\":\"Completed\",\"billingScope\":\"mfdatscmdvpj\",\"workload\":\"DevTest\",\"resellerId\":\"uuvmkjozkrwfnd\",\"subscriptionOwnerId\":\"djpslw\",\"managementGroupId\":\"dpvwryoqpsoaccta\",\"createdTime\":\"kljla\",\"tags\":{\"expa\":\"ryffdfdosy\"}},\"id\":\"akhmsbzjhcrz\",\"name\":\"vdphlxaolthqtr\",\"type\":\"qjbpfzfsin\"}") + .toObject(SubscriptionAliasResponseInner.class); + Assertions.assertEquals("pmqnja", model.properties().displayName()); + Assertions.assertEquals(ProvisioningState.FAILED, model.properties().provisioningState()); + Assertions.assertEquals("mfdatscmdvpj", model.properties().billingScope()); + Assertions.assertEquals(Workload.DEV_TEST, model.properties().workload()); + Assertions.assertEquals("uuvmkjozkrwfnd", model.properties().resellerId()); + Assertions.assertEquals("djpslw", model.properties().subscriptionOwnerId()); + Assertions.assertEquals("dpvwryoqpsoaccta", model.properties().managementGroupId()); + Assertions.assertEquals("kljla", model.properties().createdTime()); + Assertions.assertEquals("ryffdfdosy", model.properties().tags().get("expa")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SubscriptionAliasResponseInner model = new SubscriptionAliasResponseInner() + .withProperties(new SubscriptionAliasResponseProperties().withDisplayName("pmqnja") + .withProvisioningState(ProvisioningState.FAILED) + .withBillingScope("mfdatscmdvpj") + .withWorkload(Workload.DEV_TEST) + .withResellerId("uuvmkjozkrwfnd") + .withSubscriptionOwnerId("djpslw") + .withManagementGroupId("dpvwryoqpsoaccta") + .withCreatedTime("kljla") + .withTags(mapOf("expa", "ryffdfdosy"))); + model = BinaryData.fromObject(model).toObject(SubscriptionAliasResponseInner.class); + Assertions.assertEquals("pmqnja", model.properties().displayName()); + Assertions.assertEquals(ProvisioningState.FAILED, model.properties().provisioningState()); + Assertions.assertEquals("mfdatscmdvpj", model.properties().billingScope()); + Assertions.assertEquals(Workload.DEV_TEST, model.properties().workload()); + Assertions.assertEquals("uuvmkjozkrwfnd", model.properties().resellerId()); + Assertions.assertEquals("djpslw", model.properties().subscriptionOwnerId()); + Assertions.assertEquals("dpvwryoqpsoaccta", model.properties().managementGroupId()); + Assertions.assertEquals("kljla", model.properties().createdTime()); + Assertions.assertEquals("ryffdfdosy", model.properties().tags().get("expa")); + } + + // 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/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionAliasResponsePropertiesTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionAliasResponsePropertiesTests.java new file mode 100644 index 000000000000..30b54ff67d71 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionAliasResponsePropertiesTests.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.ProvisioningState; +import com.azure.resourcemanager.subscription.models.SubscriptionAliasResponseProperties; +import com.azure.resourcemanager.subscription.models.Workload; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Assertions; + +public final class SubscriptionAliasResponsePropertiesTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SubscriptionAliasResponseProperties model = BinaryData.fromString( + "{\"subscriptionId\":\"v\",\"displayName\":\"jrwzox\",\"provisioningState\":\"Failed\",\"acceptOwnershipUrl\":\"elluwfziton\",\"acceptOwnershipState\":\"Pending\",\"billingScope\":\"pjkjlxofpdv\",\"workload\":\"DevTest\",\"resellerId\":\"xypininmayhuybbk\",\"subscriptionOwnerId\":\"depoog\",\"managementGroupId\":\"uvamiheognarxzxt\",\"createdTime\":\"o\",\"tags\":{\"bwjzr\":\"ivyevcciqihnhun\"}}") + .toObject(SubscriptionAliasResponseProperties.class); + Assertions.assertEquals("jrwzox", model.displayName()); + Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); + Assertions.assertEquals("pjkjlxofpdv", model.billingScope()); + Assertions.assertEquals(Workload.DEV_TEST, model.workload()); + Assertions.assertEquals("xypininmayhuybbk", model.resellerId()); + Assertions.assertEquals("depoog", model.subscriptionOwnerId()); + Assertions.assertEquals("uvamiheognarxzxt", model.managementGroupId()); + Assertions.assertEquals("o", model.createdTime()); + Assertions.assertEquals("ivyevcciqihnhun", model.tags().get("bwjzr")); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SubscriptionAliasResponseProperties model = new SubscriptionAliasResponseProperties().withDisplayName("jrwzox") + .withProvisioningState(ProvisioningState.FAILED) + .withBillingScope("pjkjlxofpdv") + .withWorkload(Workload.DEV_TEST) + .withResellerId("xypininmayhuybbk") + .withSubscriptionOwnerId("depoog") + .withManagementGroupId("uvamiheognarxzxt") + .withCreatedTime("o") + .withTags(mapOf("bwjzr", "ivyevcciqihnhun")); + model = BinaryData.fromObject(model).toObject(SubscriptionAliasResponseProperties.class); + Assertions.assertEquals("jrwzox", model.displayName()); + Assertions.assertEquals(ProvisioningState.FAILED, model.provisioningState()); + Assertions.assertEquals("pjkjlxofpdv", model.billingScope()); + Assertions.assertEquals(Workload.DEV_TEST, model.workload()); + Assertions.assertEquals("xypininmayhuybbk", model.resellerId()); + Assertions.assertEquals("depoog", model.subscriptionOwnerId()); + Assertions.assertEquals("uvamiheognarxzxt", model.managementGroupId()); + Assertions.assertEquals("o", model.createdTime()); + Assertions.assertEquals("ivyevcciqihnhun", model.tags().get("bwjzr")); + } + + // 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/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionCreationResultInnerTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionCreationResultInnerTests.java new file mode 100644 index 000000000000..3f1b69b2b411 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionCreationResultInnerTests.java @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.fluent.models.SubscriptionCreationResultInner; +import org.junit.jupiter.api.Assertions; + +public final class SubscriptionCreationResultInnerTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + SubscriptionCreationResultInner model = BinaryData.fromString("{\"subscriptionLink\":\"cmsxaobhdxbm\"}") + .toObject(SubscriptionCreationResultInner.class); + Assertions.assertEquals("cmsxaobhdxbm", model.subscriptionLink()); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + SubscriptionCreationResultInner model + = new SubscriptionCreationResultInner().withSubscriptionLink("cmsxaobhdxbm"); + model = BinaryData.fromObject(model).toObject(SubscriptionCreationResultInner.class); + Assertions.assertEquals("cmsxaobhdxbm", model.subscriptionLink()); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionNameTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionNameTests.java index d87bd629774d..357cd1dfe42b 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionNameTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionNameTests.java @@ -12,14 +12,14 @@ public final class SubscriptionNameTests { @org.junit.jupiter.api.Test public void testDeserialize() throws Exception { SubscriptionName model - = BinaryData.fromString("{\"subscriptionName\":\"tusivyevcciqihn\"}").toObject(SubscriptionName.class); - Assertions.assertEquals("tusivyevcciqihn", model.subscriptionName()); + = BinaryData.fromString("{\"subscriptionName\":\"czmehmtzopbsp\"}").toObject(SubscriptionName.class); + Assertions.assertEquals("czmehmtzopbsp", model.subscriptionName()); } @org.junit.jupiter.api.Test public void testSerialize() throws Exception { - SubscriptionName model = new SubscriptionName().withSubscriptionName("tusivyevcciqihn"); + SubscriptionName model = new SubscriptionName().withSubscriptionName("czmehmtzopbsp"); model = BinaryData.fromObject(model).toObject(SubscriptionName.class); - Assertions.assertEquals("tusivyevcciqihn", model.subscriptionName()); + Assertions.assertEquals("czmehmtzopbsp", model.subscriptionName()); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsListLocationsMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsGetWithResponseMockTests.java similarity index 58% rename from sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsListLocationsMockTests.java rename to sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsGetWithResponseMockTests.java index 66c22fa71c8f..b209178115f4 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsListLocationsMockTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsGetWithResponseMockTests.java @@ -6,32 +6,33 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.subscription.SubscriptionManager; -import com.azure.resourcemanager.subscription.models.Location; +import com.azure.resourcemanager.subscription.models.SubscriptionCreationResult; 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 SubscriptionsListLocationsMockTests { +public final class SubscriptionOperationsGetWithResponseMockTests { @Test - public void testListLocations() throws Exception { - String responseStr - = "{\"value\":[{\"id\":\"itnwuizgazxufi\",\"subscriptionId\":\"ckyfih\",\"name\":\"idf\",\"displayName\":\"wdzuhtymwisd\",\"latitude\":\"thwxmnteiwaopvkm\",\"longitude\":\"c\"}]}"; + public void testGetWithResponse() throws Exception { + String responseStr = "{\"subscriptionLink\":\"ienjbdlwtgr\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SubscriptionManager manager = SubscriptionManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - PagedIterable response - = manager.subscriptions().listLocations("uhmuouqfprwzwbn", com.azure.core.util.Context.NONE); + SubscriptionCreationResult response = manager.subscriptionOperations() + .getWithResponse("njeaseipheofloke", com.azure.core.util.Context.NONE) + .getValue(); + Assertions.assertEquals("ienjbdlwtgr", response.subscriptionLink()); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesAddUpdatePolicyForTenantWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesAddUpdatePolicyForTenantWithResponseMockTests.java new file mode 100644 index 000000000000..b70e5cce2d11 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesAddUpdatePolicyForTenantWithResponseMockTests.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.SubscriptionManager; +import com.azure.resourcemanager.subscription.models.GetTenantPolicyResponse; +import com.azure.resourcemanager.subscription.models.PutTenantPolicyRequestProperties; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SubscriptionPoliciesAddUpdatePolicyForTenantWithResponseMockTests { + @Test + public void testAddUpdatePolicyForTenantWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"policyId\":\"bniwdj\",\"blockSubscriptionsLeavingTenant\":false,\"blockSubscriptionsIntoTenant\":false,\"exemptedPrincipals\":[\"1a9785a0-8897-4c22-9ce7-68fc76d523c0\"]},\"id\":\"gnxytxhpzxbz\",\"name\":\"fzab\",\"type\":\"lcuhxwtctyqiklb\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SubscriptionManager manager = SubscriptionManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + GetTenantPolicyResponse response = manager.subscriptionPolicies() + .addUpdatePolicyForTenantWithResponse( + new PutTenantPolicyRequestProperties().withBlockSubscriptionsLeavingTenant(true) + .withBlockSubscriptionsIntoTenant(true) + .withExemptedPrincipals(Arrays.asList(UUID.fromString("5672b716-effa-431f-8bf2-eb66626b97b7"), + UUID.fromString("3828b643-ba29-4d42-9ae8-4f014c41bdf6"), + UUID.fromString("baaf9c68-453b-4d0e-a491-f18928520c39"), + UUID.fromString("072162fc-7e49-42f3-b6e4-f0ca25e108bf"))), + com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertFalse(response.properties().blockSubscriptionsLeavingTenant()); + Assertions.assertFalse(response.properties().blockSubscriptionsIntoTenant()); + Assertions.assertEquals(UUID.fromString("1a9785a0-8897-4c22-9ce7-68fc76d523c0"), + response.properties().exemptedPrincipals().get(0)); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesGetPolicyForTenantWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesGetPolicyForTenantWithResponseMockTests.java new file mode 100644 index 000000000000..19c1061514e7 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesGetPolicyForTenantWithResponseMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.SubscriptionManager; +import com.azure.resourcemanager.subscription.models.GetTenantPolicyResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SubscriptionPoliciesGetPolicyForTenantWithResponseMockTests { + @Test + public void testGetPolicyForTenantWithResponse() throws Exception { + String responseStr + = "{\"properties\":{\"policyId\":\"plwzbhvgyugu\",\"blockSubscriptionsLeavingTenant\":true,\"blockSubscriptionsIntoTenant\":true,\"exemptedPrincipals\":[\"3482294d-2fcc-4207-b22d-9e5cee9d56b9\"]},\"id\":\"xquk\",\"name\":\"fpl\",\"type\":\"mg\"}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SubscriptionManager manager = SubscriptionManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + GetTenantPolicyResponse response = manager.subscriptionPolicies() + .getPolicyForTenantWithResponse(com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertTrue(response.properties().blockSubscriptionsLeavingTenant()); + Assertions.assertTrue(response.properties().blockSubscriptionsIntoTenant()); + Assertions.assertEquals(UUID.fromString("3482294d-2fcc-4207-b22d-9e5cee9d56b9"), + response.properties().exemptedPrincipals().get(0)); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesListPolicyForTenantMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesListPolicyForTenantMockTests.java new file mode 100644 index 000000000000..11878a6eccab --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesListPolicyForTenantMockTests.java @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.SubscriptionManager; +import com.azure.resourcemanager.subscription.models.GetTenantPolicyResponse; +import java.nio.charset.StandardCharsets; +import java.time.OffsetDateTime; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import reactor.core.publisher.Mono; + +public final class SubscriptionPoliciesListPolicyForTenantMockTests { + @Test + public void testListPolicyForTenant() throws Exception { + String responseStr + = "{\"value\":[{\"properties\":{\"policyId\":\"kjz\",\"blockSubscriptionsLeavingTenant\":false,\"blockSubscriptionsIntoTenant\":false,\"exemptedPrincipals\":[\"16c7317f-d654-4f7b-9ab1-7e393da672ac\",\"fb826feb-5b60-4820-b5f6-48306d75afe5\",\"345bec4d-0153-4111-8e41-d83dd430eb9f\"]},\"id\":\"opwi\",\"name\":\"ighxpk\",\"type\":\"wzbaiue\"}]}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SubscriptionManager manager = SubscriptionManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + PagedIterable response + = manager.subscriptionPolicies().listPolicyForTenant(com.azure.core.util.Context.NONE); + + Assertions.assertFalse(response.iterator().next().properties().blockSubscriptionsLeavingTenant()); + Assertions.assertFalse(response.iterator().next().properties().blockSubscriptionsIntoTenant()); + Assertions.assertEquals(UUID.fromString("16c7317f-d654-4f7b-9ab1-7e393da672ac"), + response.iterator().next().properties().exemptedPrincipals().get(0)); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesTests.java deleted file mode 100644 index 43b04c3a21f5..000000000000 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionPoliciesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.subscription.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.subscription.models.SubscriptionPolicies; - -public final class SubscriptionPoliciesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SubscriptionPolicies model = BinaryData - .fromString("{\"locationPlacementId\":\"vd\",\"quotaId\":\"jgrtfwvukxga\",\"spendingLimit\":\"Off\"}") - .toObject(SubscriptionPolicies.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SubscriptionPolicies model = new SubscriptionPolicies(); - model = BinaryData.fromObject(model).toObject(SubscriptionPolicies.class); - } -} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsAcceptOwnershipStatusWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsAcceptOwnershipStatusWithResponseMockTests.java new file mode 100644 index 000000000000..f2a910c4efb8 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsAcceptOwnershipStatusWithResponseMockTests.java @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.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.subscription.SubscriptionManager; +import com.azure.resourcemanager.subscription.models.AcceptOwnershipStatusResponse; +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 SubscriptionsAcceptOwnershipStatusWithResponseMockTests { + @Test + public void testAcceptOwnershipStatusWithResponse() throws Exception { + String responseStr + = "{\"subscriptionId\":\"oo\",\"acceptOwnershipState\":\"Expired\",\"provisioningState\":\"Pending\",\"billingOwner\":\"v\",\"subscriptionTenantId\":\"m\",\"displayName\":\"qabcypm\",\"tags\":{\"zuvccfwnfnbacfio\":\"w\",\"bxetqgtzxdpn\":\"l\",\"eallnwsubisnj\":\"bqqwxrj\",\"hcbonqvpkvlr\":\"mpmngnzscxaqwoo\"}}"; + + HttpClient httpClient + = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); + SubscriptionManager manager = SubscriptionManager.configure() + .withHttpClient(httpClient) + .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); + + AcceptOwnershipStatusResponse response = manager.subscriptions() + .acceptOwnershipStatusWithResponse("fvm", com.azure.core.util.Context.NONE) + .getValue(); + + Assertions.assertEquals("m", response.subscriptionTenantId()); + Assertions.assertEquals("qabcypm", response.displayName()); + Assertions.assertEquals("w", response.tags().get("zuvccfwnfnbacfio")); + } +} diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsCancelWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsCancelWithResponseMockTests.java similarity index 72% rename from sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsCancelWithResponseMockTests.java rename to sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsCancelWithResponseMockTests.java index be52dd8d5c6b..fd94deee6e23 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsCancelWithResponseMockTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsCancelWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.subscription.SubscriptionManager; import com.azure.resourcemanager.subscription.models.CanceledSubscriptionId; @@ -16,21 +16,20 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class SubscriptionOperationsCancelWithResponseMockTests { +public final class SubscriptionsCancelWithResponseMockTests { @Test public void testCancelWithResponse() throws Exception { - String responseStr = "{\"subscriptionId\":\"kexxppof\"}"; + String responseStr = "{\"subscriptionId\":\"dqmidtt\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SubscriptionManager manager = SubscriptionManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - CanceledSubscriptionId response = manager.subscriptionOperations() - .cancelWithResponse("qsycbkbfkgu", com.azure.core.util.Context.NONE) - .getValue(); + CanceledSubscriptionId response + = manager.subscriptions().cancelWithResponse("efgugnxk", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsEnableWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsEnableWithResponseMockTests.java similarity index 72% rename from sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsEnableWithResponseMockTests.java rename to sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsEnableWithResponseMockTests.java index f28e910d34f9..465403f1a66b 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsEnableWithResponseMockTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsEnableWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.subscription.SubscriptionManager; import com.azure.resourcemanager.subscription.models.EnabledSubscriptionId; @@ -16,21 +16,20 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class SubscriptionOperationsEnableWithResponseMockTests { +public final class SubscriptionsEnableWithResponseMockTests { @Test public void testEnableWithResponse() throws Exception { - String responseStr = "{\"subscriptionId\":\"icbtwnpzao\"}"; + String responseStr = "{\"subscriptionId\":\"hzgpphrcgyncocpe\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SubscriptionManager manager = SubscriptionManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - EnabledSubscriptionId response = manager.subscriptionOperations() - .enableWithResponse("jnxqbzvddntwn", com.azure.core.util.Context.NONE) - .getValue(); + EnabledSubscriptionId response + = manager.subscriptions().enableWithResponse("ywgndrv", com.azure.core.util.Context.NONE).getValue(); } } diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsRenameWithResponseMockTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsRenameWithResponseMockTests.java similarity index 74% rename from sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsRenameWithResponseMockTests.java rename to sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsRenameWithResponseMockTests.java index 5a2258fd3335..f065722d914e 100644 --- a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionOperationsRenameWithResponseMockTests.java +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/SubscriptionsRenameWithResponseMockTests.java @@ -6,8 +6,8 @@ import com.azure.core.credential.AccessToken; import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; import com.azure.core.management.profile.AzureProfile; +import com.azure.core.models.AzureCloud; import com.azure.core.test.http.MockHttpResponse; import com.azure.resourcemanager.subscription.SubscriptionManager; import com.azure.resourcemanager.subscription.models.RenamedSubscriptionId; @@ -17,20 +17,20 @@ import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; -public final class SubscriptionOperationsRenameWithResponseMockTests { +public final class SubscriptionsRenameWithResponseMockTests { @Test public void testRenameWithResponse() throws Exception { - String responseStr = "{\"subscriptionId\":\"bqe\"}"; + String responseStr = "{\"subscriptionId\":\"kanyktzlcuiywg\"}"; HttpClient httpClient = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); SubscriptionManager manager = SubscriptionManager.configure() .withHttpClient(httpClient) .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); + new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - RenamedSubscriptionId response = manager.subscriptionOperations() - .renameWithResponse("xaxcfjpgddtocjjx", new SubscriptionName().withSubscriptionName("pmouexhdz"), + RenamedSubscriptionId response = manager.subscriptions() + .renameWithResponse("zrvqdr", new SubscriptionName().withSubscriptionName("hjybigehoqfbo"), com.azure.core.util.Context.NONE) .getValue(); diff --git a/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/TenantPolicyTests.java b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/TenantPolicyTests.java new file mode 100644 index 000000000000..ee5a9cccaa74 --- /dev/null +++ b/sdk/subscription/azure-resourcemanager-subscription/src/test/java/com/azure/resourcemanager/subscription/generated/TenantPolicyTests.java @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.subscription.generated; + +import com.azure.core.util.BinaryData; +import com.azure.resourcemanager.subscription.models.TenantPolicy; +import java.util.Arrays; +import java.util.UUID; +import org.junit.jupiter.api.Assertions; + +public final class TenantPolicyTests { + @org.junit.jupiter.api.Test + public void testDeserialize() throws Exception { + TenantPolicy model = BinaryData.fromString( + "{\"policyId\":\"j\",\"blockSubscriptionsLeavingTenant\":false,\"blockSubscriptionsIntoTenant\":true,\"exemptedPrincipals\":[\"a71c6e4b-089c-4aac-8833-260b2bf453ac\",\"d6b00d3e-1cbd-4380-8c9f-2005449f0a25\"]}") + .toObject(TenantPolicy.class); + Assertions.assertFalse(model.blockSubscriptionsLeavingTenant()); + Assertions.assertTrue(model.blockSubscriptionsIntoTenant()); + Assertions.assertEquals(UUID.fromString("a71c6e4b-089c-4aac-8833-260b2bf453ac"), + model.exemptedPrincipals().get(0)); + } + + @org.junit.jupiter.api.Test + public void testSerialize() throws Exception { + TenantPolicy model = new TenantPolicy().withBlockSubscriptionsLeavingTenant(false) + .withBlockSubscriptionsIntoTenant(true) + .withExemptedPrincipals(Arrays.asList(UUID.fromString("a71c6e4b-089c-4aac-8833-260b2bf453ac"), + UUID.fromString("d6b00d3e-1cbd-4380-8c9f-2005449f0a25"))); + model = BinaryData.fromObject(model).toObject(TenantPolicy.class); + Assertions.assertFalse(model.blockSubscriptionsLeavingTenant()); + Assertions.assertTrue(model.blockSubscriptionsIntoTenant()); + Assertions.assertEquals(UUID.fromString("a71c6e4b-089c-4aac-8833-260b2bf453ac"), + model.exemptedPrincipals().get(0)); + } +} diff --git a/sdk/template/azure-template-stress/pom.xml b/sdk/template/azure-template-stress/pom.xml index f952e12a3884..75583b590270 100644 --- a/sdk/template/azure-template-stress/pom.xml +++ b/sdk/template/azure-template-stress/pom.xml @@ -59,7 +59,7 @@ io.vertx vertx-codegen - 4.5.17 + 4.5.23 provided @@ -98,7 +98,7 @@ io.opentelemetry.instrumentation:opentelemetry-runtime-telemetry-java8:[2.14.0-alpha] io.opentelemetry.instrumentation:opentelemetry-logback-appender-1.0:[2.14.0-alpha] ch.qos.logback:logback-classic:[1.3.14] - io.vertx:vertx-codegen:[4.5.17] + io.vertx:vertx-codegen:[4.5.23] diff --git a/sdk/transcription/azure-ai-speech-transcription/CHANGELOG.md b/sdk/transcription/azure-ai-speech-transcription/CHANGELOG.md new file mode 100644 index 000000000000..b58ccd5d505b --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/CHANGELOG.md @@ -0,0 +1,17 @@ +# Release History + +## 1.0.0-beta.2 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes + +## 1.0.0-beta.1 (2026-01-05) + +### Features Added + +- Initial release of Azure AI Speech Transcription client library for Java. diff --git a/sdk/transcription/azure-ai-speech-transcription/README.md b/sdk/transcription/azure-ai-speech-transcription/README.md new file mode 100644 index 000000000000..7180668de8d3 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/README.md @@ -0,0 +1,305 @@ +# Azure AI Speech Transcription client library for Java + +The Azure AI Speech Transcription client library provides a simple and efficient way to convert audio to text using Azure Cognitive Services. This library enables you to transcribe audio with features like speaker diarization, profanity filtering, and phrase hints for improved accuracy. + +## Documentation + +Various documentation is available to help you get started: + +- [API reference documentation][docs] +- [Product documentation][product_documentation] +- [Azure Speech Service documentation](https://learn.microsoft.com/azure/ai-services/speech-service/) + +## Getting started + +### Prerequisites + +- [Java Development Kit (JDK)][jdk] with version 8 or above +- [Azure Subscription][azure_subscription] +- An [Azure Speech resource](https://learn.microsoft.com/azure/ai-services/speech-service/overview#try-the-speech-service-for-free) or [Cognitive Services multi-service resource](https://learn.microsoft.com/azure/ai-services/multi-service-resource) + +### Adding the package to your product + +[//]: # ({x-version-update-start;com.azure:azure-ai-speech-transcription;current}) +```xml + + com.azure + azure-ai-speech-transcription + 1.0.0-beta.1 + +``` +[//]: # ({x-version-update-end}) + +#### Optional: For Entra ID Authentication + +If you plan to use Entra ID authentication (recommended for production), also add the `azure-identity` dependency: + +```xml + + com.azure + azure-identity + 1.18.1 + +``` + +### Authentication + +Azure Speech Transcription supports two authentication methods: + +#### Option 1: API Key Authentication (Subscription Key) + +You can find your Speech resource's API key in the [Azure Portal](https://portal.azure.com) or by using the Azure CLI: + +```bash +az cognitiveservices account keys list --name --resource-group +``` + +Once you have an API key, you can authenticate using `KeyCredential`: + +```java +import com.azure.core.credential.KeyCredential; + +TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); +``` + +#### Option 2: Entra ID OAuth2 Authentication (Recommended for Production) + +For production scenarios, it's recommended to use Entra ID authentication with managed identities or service principals. This provides better security and easier credential management. + +```java +import com.azure.identity.DefaultAzureCredential; +import com.azure.identity.DefaultAzureCredentialBuilder; + +// Use DefaultAzureCredential which works with managed identities, service principals, Azure CLI, etc. +DefaultAzureCredential credential = new DefaultAzureCredentialBuilder().build(); + +TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(credential) + .buildClient(); +``` + +**Note:** To use Entra ID authentication, you need to: +1. Add the `azure-identity` dependency to your project +2. Assign the appropriate role (e.g., "Cognitive Services User") to your managed identity or service principal +3. Ensure your Cognitive Services resource has Entra ID authentication enabled + +For more information on Entra ID authentication, see: +- [Authenticate with Azure Identity](https://learn.microsoft.com/azure/developer/java/sdk/identity) +- [Azure Cognitive Services authentication](https://learn.microsoft.com/azure/ai-services/authentication) + +## Key concepts + +### TranscriptionClient + +The `TranscriptionClient` is the primary interface for interacting with the Speech Transcription service. It provides methods to transcribe audio to text. + +### TranscriptionAsyncClient + +The `TranscriptionAsyncClient` provides asynchronous methods for transcribing audio, allowing non-blocking operations that return reactive types. + +### Audio Formats + +The service supports various audio formats including WAV, MP3, OGG, and more. Audio must be: + +- Shorter than 2 hours in duration +- Smaller than 250 MB in size + +### Transcription Options + +You can customize transcription with options like: + +- **Profanity filtering**: Control how profanity is handled in transcriptions +- **Speaker diarization**: Identify different speakers in multi-speaker audio +- **Phrase lists**: Provide domain-specific phrases to improve accuracy +- **Language detection**: Automatically detect the spoken language +- **Enhanced mode**: Improve transcription quality with custom prompts, translation, and task-specific configurations + +## Examples + +### Transcribe an audio file + +```java com.azure.ai.speech.transcription.readme +TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + +try { + // Read audio file + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + // Create audio file details + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Create transcription options + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + // Transcribe audio + TranscriptionResult result = client.transcribe(options); + + // Process results + System.out.println("Duration: " + result.getDuration() + " ms"); + result.getCombinedPhrases().forEach(phrase -> { + System.out.println("Channel " + phrase.getChannel() + ": " + phrase.getText()); + }); +} catch (Exception e) { + System.err.println("Error during transcription: " + e.getMessage()); +} +``` + +### Transcribe using audio URL + +You can transcribe audio directly from a URL without downloading the file first: + +```java readme-sample-transcribeWithAudioUrl +TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + +// Create transcription options with audio URL +TranscriptionOptions options = new TranscriptionOptions("https://example.com/audio.wav"); + +// Transcribe audio +TranscriptionResult result = client.transcribe(options); + +// Process results +result.getCombinedPhrases().forEach(phrase -> { + System.out.println(phrase.getText()); +}); +``` + +### Transcribe with multi-language support + +The service can automatically detect and transcribe multiple languages within the same audio file. + +```java com.azure.ai.speech.transcription.transcriptionoptions.multilanguage +byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + +AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + +// Configure transcription WITHOUT specifying locales +// This allows the service to auto-detect and transcribe multiple languages +TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + +TranscriptionResult result = client.transcribe(options); + +result.getPhrases().forEach(phrase -> { + System.out.println("Language: " + phrase.getLocale()); + System.out.println("Text: " + phrase.getText()); +}); +``` + +### Transcribe with enhanced mode + +Enhanced mode provides advanced features to improve transcription accuracy with custom prompts. Enhanced mode is automatically enabled when you create an `EnhancedModeOptions` instance. + +```java com.azure.ai.speech.transcription.transcriptionoptions.enhancedmode +byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + +AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + +// Enhanced mode is automatically enabled +EnhancedModeOptions enhancedMode = new EnhancedModeOptions() + .setTask("transcribe") + .setPrompts(java.util.Arrays.asList("Output must be in lexical format.")); + +TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setEnhancedModeOptions(enhancedMode); + +TranscriptionResult result = client.transcribe(options); + +System.out.println("Transcription: " + result.getCombinedPhrases().get(0).getText()); +``` + +### Transcribe with phrase list + +You can use a phrase list to improve recognition accuracy for specific terms. + +```java com.azure.ai.speech.transcription.transcriptionoptions.phraselist +byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + +AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + +PhraseListOptions phraseListOptions = new PhraseListOptions() + .setPhrases(java.util.Arrays.asList("Azure", "Cognitive Services")) + .setBiasingWeight(5.0); + +TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setPhraseListOptions(phraseListOptions); + +TranscriptionResult result = client.transcribe(options); + +result.getCombinedPhrases().forEach(phrase -> { + System.out.println(phrase.getText()); +}); +``` + +### Service API versions + +The client library targets the latest service API version by default. +The service client builder accepts an optional service API version parameter to specify which API version to communicate. + +#### Select a service API version + +You have the flexibility to explicitly select a supported service API version when initializing a service client via the service client builder. +This ensures that the client can communicate with services using the specified API version. + +When selecting an API version, it is important to verify that there are no breaking changes compared to the latest API version. +If there are significant differences, API calls may fail due to incompatibility. + +Always ensure that the chosen API version is fully supported and operational for your specific use case and that it aligns with the service's versioning policy. + +## Troubleshooting + +### Enable client logging + +You can enable logging to debug issues with the client library. The Azure client libraries for Java use the SLF4J logging facade. You can configure logging by adding a logging dependency and configuration file. For more information, see the [logging documentation](https://learn.microsoft.com/azure/developer/java/sdk/logging-overview). + +### Common issues + +#### Authentication errors + +- Verify that your API key is correct +- Ensure your endpoint URL matches your Azure resource region + +#### Audio format errors + +- Verify your audio file is in a supported format +- Ensure the audio file size is under 250 MB and duration is under 2 hours + +### Getting help + +If you encounter issues: + +- Check the [troubleshooting guide](https://learn.microsoft.com/azure/ai-services/speech-service/troubleshooting) +- Search for existing issues or create a new one on [GitHub](https://github.com/Azure/azure-sdk-for-java/issues) +- Ask questions on [Stack Overflow](https://stackoverflow.com/questions/tagged/azure-java-sdk) with the `azure-java-sdk` tag + +## Next steps + +- Explore the [samples](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/transcription/azure-ai-speech-transcription/src/samples) for more examples +- Learn more about [Azure Speech Service](https://learn.microsoft.com/azure/ai-services/speech-service/) +- Review the [API reference documentation][docs] for detailed information about classes and methods + +## Contributing + + +For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md). + +1. Fork it +1. Create your feature branch (`git checkout -b my-new-feature`) +1. Commit your changes (`git commit -am 'Add some feature'`) +1. Push to the branch (`git push origin my-new-feature`) +1. Create new Pull Request + + +[product_documentation]: https://learn.microsoft.com/azure/ai-services/speech-service/ +[docs]: https://azure.github.io/azure-sdk-for-java/ +[jdk]: https://learn.microsoft.com/azure/developer/java/fundamentals/ +[azure_subscription]: https://azure.microsoft.com/free/ + diff --git a/sdk/transcription/azure-ai-speech-transcription/assets.json b/sdk/transcription/azure-ai-speech-transcription/assets.json new file mode 100644 index 000000000000..0678580b84a5 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/assets.json @@ -0,0 +1,6 @@ +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "java", + "TagPrefix": "java/transcription/azure-ai-speech-transcription", + "Tag": "java/transcription/azure-ai-speech-transcription_c82ca4aec0" +} diff --git a/sdk/transcription/azure-ai-speech-transcription/cspell.json b/sdk/transcription/azure-ai-speech-transcription/cspell.json new file mode 100644 index 000000000000..4c33070b4f8d --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/cspell.json @@ -0,0 +1,16 @@ +{ + "version": "0.2", + "language": "en", + "words": [ + "azuread", + "BYOD", + "BYOS", + "dexec", + "diarization", + "doméstica", + "empleada", + "habitación", + "misrecognized", + "Mundo" + ] +} diff --git a/sdk/transcription/azure-ai-speech-transcription/customization/pom.xml b/sdk/transcription/azure-ai-speech-transcription/customization/pom.xml new file mode 100644 index 000000000000..3c3058bef116 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/customization/pom.xml @@ -0,0 +1,48 @@ + + + 4.0.0 + + + com.azure + azure-code-customization-parent + 1.0.0-beta.1 + ../../../parents/azure-code-customization-parent + + + azure-ai-speech-transcription-customization + 1.0.0-beta.1 + jar + + + + ../../../.. + + + + + + + org.apache.maven.plugins + maven-antrun-plugin + + + copy + none + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + none + + + + + + diff --git a/sdk/transcription/azure-ai-speech-transcription/customization/src/main/java/SpeechTranscriptionCustomization.java b/sdk/transcription/azure-ai-speech-transcription/customization/src/main/java/SpeechTranscriptionCustomization.java new file mode 100644 index 000000000000..d0bdf355bdb0 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/customization/src/main/java/SpeechTranscriptionCustomization.java @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +import com.azure.autorest.customization.Customization; +import com.azure.autorest.customization.LibraryCustomization; +import com.azure.autorest.customization.PackageCustomization; +import com.azure.autorest.customization.ClassCustomization; +import com.github.javaparser.ast.Modifier; +import com.github.javaparser.ast.NodeList; +import com.github.javaparser.ast.body.BodyDeclaration; +import com.github.javaparser.ast.body.ConstructorDeclaration; +import com.github.javaparser.ast.stmt.BlockStmt; +import com.github.javaparser.ast.stmt.Statement; +import com.github.javaparser.javadoc.Javadoc; +import com.github.javaparser.javadoc.JavadocBlockTag; +import com.github.javaparser.javadoc.description.JavadocDescription; +import org.slf4j.Logger; + +import java.time.Duration; + +import static com.github.javaparser.StaticJavaParser.parseBlock; +import static com.github.javaparser.StaticJavaParser.parseStatement; +import static com.github.javaparser.javadoc.description.JavadocDescription.parseText; + +/** + * Code customization after code generation for Speech Transcription SDK. + */ +public class SpeechTranscriptionCustomization extends Customization { + + /** + * Creates an instance of SpeechTranscriptionCustomization. + */ + public SpeechTranscriptionCustomization() { + } + + @Override + public void customize(LibraryCustomization customization, Logger logger) { + logger.info("Customizing Speech Transcription SDK"); + + // Check if models package exists before attempting customization + try { + PackageCustomization models = customization.getPackage("com.azure.ai.speech.transcription.models"); + + logger.info("Models package found - applying model customizations"); + + // Customize TranscriptionResult.getDuration() to return Duration instead of int + logger.info("Customizing TranscriptionResult.getDuration()"); + customizeDurationGetter(models, "TranscriptionResult"); + + // Customize TranscribedPhrase.getDuration() to return Duration instead of int + logger.info("Customizing TranscribedPhrase.getDuration()"); + customizeDurationGetter(models, "TranscribedPhrase"); + + // Customize TranscribedWord.getDuration() to return Duration instead of int + logger.info("Customizing TranscribedWord.getDuration()"); + customizeDurationGetter(models, "TranscribedWord"); + + // Customize TranscriptionDiarizationOptions to properly serialize enabled field + logger.info("Customizing TranscriptionDiarizationOptions.toJson()"); + customizeDiarizationOptionsToJson(models); + + // Customize EnhancedModeOptions constructor to auto-set enabled to true + logger.info("Customizing EnhancedModeOptions constructor to auto-set enabled to true"); + customizeEnhancedModeOptions(models); + + // Customize AudioFileDetails.getFilename() to auto-generate filename from contentType if not set + logger.info("Customizing AudioFileDetails.getFilename() to auto-generate filename"); + customizeAudioFileDetailsGetFilename(models); + + // Add AudioFileDetails field and constructors to TranscriptionOptions, make setAudioUrl private, remove no-arg constructor + logger + .info("Customizing TranscriptionOptions to add AudioFileDetails support and remove no-arg constructor"); + customizeTranscriptionOptions(models); + } catch (IllegalArgumentException e) { + logger.warn("Models package not found or empty - skipping model customizations: " + e.getMessage()); + } + + // Make transcribe(TranscriptionContent) package-private in clients + logger.info("Customizing TranscriptionClient to make transcribe(TranscriptionContent) package-private"); + customizeTranscriptionClient(customization.getPackage("com.azure.ai.speech.transcription")); + + logger.info("Customizing TranscriptionAsyncClient to make transcribe(TranscriptionContent) package-private"); + customizeTranscriptionAsyncClient(customization.getPackage("com.azure.ai.speech.transcription")); + } + + /** + * Customize the getDuration() method to return Duration type instead of int. + * The backing field remains as int (milliseconds), but the getter converts it to Duration. + * + * @param packageCustomization the package customization + * @param className the name of the class to customize + */ + private void customizeDurationGetter(PackageCustomization packageCustomization, String className) { + packageCustomization.getClass(className).customizeAst(ast -> { + ast.addImport("java.time.Duration"); + ast.getClassByName(className).ifPresent(clazz -> clazz.getMethodsByName("getDuration").forEach(method -> { + method.setType("Duration") + .setBody(parseBlock("{ return Duration.ofMillis(this.duration); }")) + .setJavadocComment( + new Javadoc(parseText("Get the duration property: The duration in milliseconds.")) + .addBlockTag("return", "the duration value as Duration.")); + })); + }); + } + + /** + * Customize the TranscriptionDiarizationOptions.toJson() method to properly serialize the enabled field. + * When maxSpeakers is set, enabled should be automatically set to true and serialized. + * + * @param packageCustomization the package customization + */ + private void customizeDiarizationOptionsToJson(PackageCustomization packageCustomization) { + packageCustomization.getClass("TranscriptionDiarizationOptions").customizeAst(ast -> { + ast.getClassByName("TranscriptionDiarizationOptions") + .ifPresent(clazz -> clazz.getMethodsByName("toJson").forEach(method -> { + method.setBody(parseBlock( + "{ jsonWriter.writeStartObject(); if (this.maxSpeakers != null) { jsonWriter.writeBooleanField(\"enabled\", true); jsonWriter.writeNumberField(\"maxSpeakers\", this.maxSpeakers); } return jsonWriter.writeEndObject(); }")); + })); + }); + } + + /** + * Customize EnhancedModeOptions to hide the enabled property from the public API. + * The enabled property is automatically set to true in the constructor. + * Both isEnabled() getter and setEnabled() setter are removed from the public API. + * + * @param packageCustomization the package customization + */ + private void customizeEnhancedModeOptions(PackageCustomization packageCustomization) { + packageCustomization.getClass("EnhancedModeOptions").customizeAst(ast -> { + ast.getClassByName("EnhancedModeOptions").ifPresent(clazz -> { + // Remove the @Generated no-arg constructor and replace with one that sets enabled = true + clazz.getConstructors() + .stream() + .filter(c -> c.getParameters().isEmpty()) + .findFirst() + .ifPresent(constructor -> { + // Remove @Generated annotation to prevent overwriting + constructor.getAnnotationByName("Generated").ifPresent(com.github.javaparser.ast.Node::remove); + // Set the constructor body to initialize enabled = true + constructor.setBody(parseBlock("{ this.enabled = true; }")); + // Add JavaDoc + constructor.setJavadocComment( + new Javadoc(parseText( + "Creates an instance of EnhancedModeOptions class with enhanced mode automatically enabled."))); + }); + + // Remove isEnabled() getter to hide enabled from public API + clazz.getMethodsByName("isEnabled").forEach(method -> method.remove()); + + // Remove ALL setEnabled() methods to hide enabled from public API + clazz.getMethodsByName("setEnabled").forEach(method -> method.remove()); + }); + }); + } + + /** + * Customize AudioFileDetails.getFilename() to auto-generate a filename from contentType if not explicitly set. + * This allows developers to omit setFilename() and have the SDK automatically provide a sensible default. + * + * @param packageCustomization the package customization + */ + private void customizeAudioFileDetailsGetFilename(PackageCustomization packageCustomization) { + packageCustomization.getClass("AudioFileDetails").customizeAst(ast -> { + ast.getClassByName("AudioFileDetails").ifPresent(clazz -> { + clazz.getMethodsByName("getFilename").forEach(method -> { + method.setBody(parseBlock( + "{ if (this.filename != null && !this.filename.isEmpty()) { return this.filename; } " + + "if (\"audio/wav\".equalsIgnoreCase(this.contentType)) { return \"audio.wav\"; } " + + "if (\"audio/mpeg\".equalsIgnoreCase(this.contentType) || \"audio/mp3\".equalsIgnoreCase(this.contentType)) { return \"audio.mp3\"; } " + + "if (\"audio/ogg\".equalsIgnoreCase(this.contentType)) { return \"audio.ogg\"; } " + + "if (\"audio/flac\".equalsIgnoreCase(this.contentType)) { return \"audio.flac\"; } " + + "if (\"audio/webm\".equalsIgnoreCase(this.contentType)) { return \"audio.webm\"; } " + + "if (\"audio/opus\".equalsIgnoreCase(this.contentType)) { return \"audio.opus\"; } " + + "return \"audio\"; }")); + method.setJavadocComment( + new Javadoc(parseText("Get the filename property: The filename of the file. " + + "If not explicitly set, a filename will be auto-generated from the contentType.")) + .addBlockTag("return", "the filename value, or an auto-generated filename if not set.")); + }); + }); + }); + } + + /** + * Customize TranscriptionOptions to: + * 1. Add AudioFileDetails field (final) + * 2. Remove default no-arg constructor + * 3. Add constructor with String audioUrl parameter + * 4. Add constructor with AudioFileDetails parameter + * 5. Add getFileDetails() method to access AudioFileDetails + * 6. Make setAudioUrl() private instead of public + * 7. Fix fromJson to use one of the parameterized constructors + * + * @param packageCustomization the package customization + */ + private void customizeTranscriptionOptions(PackageCustomization packageCustomization) { + packageCustomization.getClass("TranscriptionOptions").customizeAst(ast -> { + ast.getClassByName("TranscriptionOptions").ifPresent(clazz -> { + // Add the AudioFileDetails field as final + clazz.addFieldWithInitializer("AudioFileDetails", "audioFileDetails", null, + com.github.javaparser.ast.Modifier.Keyword.PRIVATE, + com.github.javaparser.ast.Modifier.Keyword.FINAL); + + // Remove default no-arg constructor + clazz.getConstructors() + .stream() + .filter(c -> c.getParameters().isEmpty()) + .findFirst() + .ifPresent(com.github.javaparser.ast.Node::remove); + + // Fix fromJson method to use parameterized constructor instead of no-arg + clazz.getMethodsByName("fromJson").forEach(method -> { + // Replace the entire method body to use the String constructor + method.setBody(parseBlock("{ return jsonReader.readObject(reader -> { " + + "TranscriptionOptions deserializedTranscriptionOptions = new TranscriptionOptions((String) null); " + + "while (reader.nextToken() != JsonToken.END_OBJECT) { " + + "String fieldName = reader.getFieldName(); " + "reader.nextToken(); " + + "if (\"audioUrl\".equals(fieldName)) { " + + "deserializedTranscriptionOptions.audioUrl = reader.getString(); " + + "} else if (\"locales\".equals(fieldName)) { " + + "List locales = reader.readArray(reader1 -> reader1.getString()); " + + "deserializedTranscriptionOptions.locales = locales; " + + "} else if (\"localeModelMapping\".equals(fieldName)) { " + + "Map localeModelMapping = reader.readMap(reader1 -> reader1.getString()); " + + "deserializedTranscriptionOptions.localeModelMapping = localeModelMapping; " + + "} else if (\"profanityFilterMode\".equals(fieldName)) { " + + "deserializedTranscriptionOptions.profanityFilterMode = ProfanityFilterMode.fromString(reader.getString()); " + + "} else if (\"diarization\".equals(fieldName)) { " + + "deserializedTranscriptionOptions.diarizationOptions = TranscriptionDiarizationOptions.fromJson(reader); " + + "} else if (\"channels\".equals(fieldName)) { " + + "List activeChannels = reader.readArray(reader1 -> reader1.getInt()); " + + "deserializedTranscriptionOptions.activeChannels = activeChannels; " + + "} else if (\"enhancedMode\".equals(fieldName)) { " + + "deserializedTranscriptionOptions.enhancedModeOptions = EnhancedModeOptions.fromJson(reader); " + + "} else if (\"phraseList\".equals(fieldName)) { " + + "deserializedTranscriptionOptions.phraseListOptions = PhraseListOptions.fromJson(reader); " + + "} else { " + "reader.skipChildren(); " + "} " + "} " + + "return deserializedTranscriptionOptions; " + "}); }")); + }); + + // Add constructor with String audioUrl parameter + ConstructorDeclaration audioUrlConstructor = clazz.addConstructor(Modifier.Keyword.PUBLIC); + audioUrlConstructor.addParameter("String", "audioUrl"); + audioUrlConstructor.setBody(parseBlock("{ this.audioUrl = audioUrl; this.audioFileDetails = null; }")); + audioUrlConstructor.setJavadocComment( + new Javadoc(parseText("Creates an instance of TranscriptionOptions class with audio URL.")) + .addBlockTag("param", "audioUrl the URL of the audio to be transcribed")); + + // Add constructor with AudioFileDetails parameter + ConstructorDeclaration fileDetailsConstructor = clazz.addConstructor(Modifier.Keyword.PUBLIC); + fileDetailsConstructor.addParameter("AudioFileDetails", "fileDetails"); + fileDetailsConstructor.setBody(parseBlock("{ this.audioFileDetails = fileDetails; }")); + fileDetailsConstructor.setJavadocComment( + new Javadoc(parseText("Creates an instance of TranscriptionOptions class with audio file details.")) + .addBlockTag("param", "fileDetails the audio file details")); + + // Add getFileDetails() method + com.github.javaparser.ast.body.MethodDeclaration getFileDetailsMethod + = clazz.addMethod("getFileDetails", Modifier.Keyword.PUBLIC); + getFileDetailsMethod.setType("AudioFileDetails"); + getFileDetailsMethod.setBody(parseBlock("{ return this.audioFileDetails; }")); + getFileDetailsMethod.setJavadocComment(new Javadoc( + parseText("Get the audioFileDetails property: The audio file details for transcription.")) + .addBlockTag("return", "the audioFileDetails value.")); + + // Make setAudioUrl() private + clazz.getMethodsByName("setAudioUrl").forEach(method -> { + method.getModifiers().clear(); + method.addModifier(Modifier.Keyword.PRIVATE); + }); + }); + }); + } + + /** + * Customize TranscriptionClient to add public transcribe(TranscriptionOptions) method + * that hides TranscriptionContent construction and add transcribeWithResponse method. + * + * @param packageCustomization the package customization + */ + private void customizeTranscriptionClient(PackageCustomization packageCustomization) { + ClassCustomization classCustomization = packageCustomization.getClass("TranscriptionClient"); + classCustomization.customizeAst(ast -> { + ast.getClassByName("TranscriptionClient").ifPresent(clazz -> { + // Make the generated transcribe(TranscriptionContent) package-private (internal) + // Only modify methods that have @Generated annotation to avoid affecting manual customizations + clazz.getMethodsByName("transcribe").forEach(method -> { + if (method.getParameters().size() == 1 + && "TranscriptionContent".equals(method.getParameter(0).getType().asString()) + && method.getAnnotationByName("Generated").isPresent()) { + // Remove all modifiers (including final), making it package-private + method.getModifiers().clear(); + // Remove @Generated annotation to prevent overwriting + method.getAnnotationByName("Generated").ifPresent(com.github.javaparser.ast.Node::remove); + } + }); + + // Add public transcribe method that returns TranscriptionResult + com.github.javaparser.ast.body.MethodDeclaration transcribeMethod + = clazz.addMethod("transcribe", Modifier.Keyword.PUBLIC) + .addParameter("TranscriptionOptions", "options") + .setType("TranscriptionResult"); + transcribeMethod.setJavadocComment("/**\n" + + " * Transcribes the provided audio stream with the specified options.\n" + " *\n" + + " * @param options the transcription options including audio file details or audio URL\n" + + " * @throws IllegalArgumentException thrown if parameters fail the validation.\n" + + " * @throws HttpResponseException thrown if the request is rejected by server.\n" + + " * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.\n" + + " * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.\n" + + " * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.\n" + + " * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n" + + " * @return the result of the transcribe operation.\n" + " */"); + com.github.javaparser.ast.expr.NormalAnnotationExpr transcribeServiceMethodAnnotation + = new com.github.javaparser.ast.expr.NormalAnnotationExpr(); + transcribeServiceMethodAnnotation.setName("ServiceMethod"); + transcribeServiceMethodAnnotation.addPair("returns", "ReturnType.SINGLE"); + transcribeMethod.addAnnotation(transcribeServiceMethodAnnotation); + transcribeMethod + .setBody(parseBlock("{ TranscriptionContent requestContent = new TranscriptionContent(options); " + + "if (options.getFileDetails() != null) { requestContent.setAudio(options.getFileDetails()); } " + + "return transcribe(requestContent); }")); + + // Add public transcribeWithResponse method that returns Response + com.github.javaparser.ast.body.MethodDeclaration transcribeWithResponseMethod + = clazz.addMethod("transcribeWithResponse", Modifier.Keyword.PUBLIC) + .addParameter("TranscriptionOptions", "options") + .setType("Response"); + transcribeWithResponseMethod.setJavadocComment("/**\n" + + " * Transcribes the provided audio stream with the specified options.\n" + " *\n" + + " * @param options the transcription options including audio file details or audio URL\n" + + " * @throws IllegalArgumentException thrown if parameters fail the validation.\n" + + " * @throws HttpResponseException thrown if the request is rejected by server.\n" + + " * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.\n" + + " * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.\n" + + " * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.\n" + + " * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n" + + " * @return the response containing the result of the transcribe operation.\n" + " */"); + com.github.javaparser.ast.expr.NormalAnnotationExpr serviceMethodAnnotation + = new com.github.javaparser.ast.expr.NormalAnnotationExpr(); + serviceMethodAnnotation.setName("ServiceMethod"); + serviceMethodAnnotation.addPair("returns", "ReturnType.SINGLE"); + transcribeWithResponseMethod.addAnnotation(serviceMethodAnnotation); + transcribeWithResponseMethod + .setBody(parseBlock("{ TranscriptionContent requestContent = new TranscriptionContent(options); " + + "if (options.getFileDetails() != null) { requestContent.setAudio(options.getFileDetails()); } " + + "RequestOptions requestOptions = new RequestOptions(); " + + "Response response = transcribeWithResponse(" + + "new MultipartFormDataHelper(requestOptions).serializeJsonField(\"definition\", requestContent.getOptions())" + + ".serializeFileField(\"audio\", requestContent.getAudio() == null ? null : requestContent.getAudio().getContent(), " + + "requestContent.getAudio() == null ? null : requestContent.getAudio().getContentType(), " + + "requestContent.getAudio() == null ? null : requestContent.getAudio().getFilename())" + + ".end().getRequestBody(), requestOptions); " + + "return new SimpleResponse<>(response, response.getValue().toObject(TranscriptionResult.class)); }")); + }); + }); + } + + /** + * Customize TranscriptionAsyncClient to make transcribe(TranscriptionContent) package-private (internal) + * and add transcribeWithResponse method. + * + * @param packageCustomization the package customization + */ + private void customizeTranscriptionAsyncClient(PackageCustomization packageCustomization) { + ClassCustomization classCustomization = packageCustomization.getClass("TranscriptionAsyncClient"); + classCustomization.customizeAst(ast -> { + ast.getClassByName("TranscriptionAsyncClient").ifPresent(clazz -> { + // Make the generated transcribe(TranscriptionContent) package-private (internal) + // Only modify methods that have @Generated annotation to avoid affecting manual customizations + clazz.getMethodsByName("transcribe").forEach(method -> { + if (method.getParameters().size() == 1 + && "TranscriptionContent".equals(method.getParameter(0).getType().asString()) + && method.getAnnotationByName("Generated").isPresent()) { + // Remove all modifiers (including final), making it package-private + method.getModifiers().clear(); + // Remove @Generated annotation to prevent overwriting + method.getAnnotationByName("Generated").ifPresent(com.github.javaparser.ast.Node::remove); + } + }); + + // Add public transcribe method that returns Mono + com.github.javaparser.ast.body.MethodDeclaration transcribeMethod + = clazz.addMethod("transcribe", Modifier.Keyword.PUBLIC) + .addParameter("TranscriptionOptions", "options") + .setType("Mono"); + transcribeMethod.setJavadocComment("/**\n" + + " * Transcribes the provided audio stream with the specified options.\n" + " *\n" + + " * @param options the transcription options including audio file details or audio URL\n" + + " * @throws IllegalArgumentException thrown if parameters fail the validation.\n" + + " * @throws HttpResponseException thrown if the request is rejected by server.\n" + + " * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.\n" + + " * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.\n" + + " * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.\n" + + " * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n" + + " * @return the result of the transcribe operation on successful completion of {@link Mono}.\n" + + " */"); + com.github.javaparser.ast.expr.NormalAnnotationExpr transcribeServiceMethodAnnotation + = new com.github.javaparser.ast.expr.NormalAnnotationExpr(); + transcribeServiceMethodAnnotation.setName("ServiceMethod"); + transcribeServiceMethodAnnotation.addPair("returns", "ReturnType.SINGLE"); + transcribeMethod.addAnnotation(transcribeServiceMethodAnnotation); + transcribeMethod + .setBody(parseBlock("{ TranscriptionContent requestContent = new TranscriptionContent(options); " + + "if (options.getFileDetails() != null) { requestContent.setAudio(options.getFileDetails()); } " + + "return transcribe(requestContent); }")); + + // Add public transcribeWithResponse method that returns Mono> + com.github.javaparser.ast.body.MethodDeclaration transcribeWithResponseMethod + = clazz.addMethod("transcribeWithResponse", Modifier.Keyword.PUBLIC) + .addParameter("TranscriptionOptions", "options") + .setType("Mono>"); + transcribeWithResponseMethod.setJavadocComment("/**\n" + + " * Transcribes the provided audio stream with the specified options.\n" + " *\n" + + " * @param options the transcription options including audio file details or audio URL\n" + + " * @throws IllegalArgumentException thrown if parameters fail the validation.\n" + + " * @throws HttpResponseException thrown if the request is rejected by server.\n" + + " * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.\n" + + " * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.\n" + + " * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.\n" + + " * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.\n" + + " * @return the response containing the result of the transcribe operation on successful completion of {@link Mono}.\n" + + " */"); + com.github.javaparser.ast.expr.NormalAnnotationExpr serviceMethodAnnotation + = new com.github.javaparser.ast.expr.NormalAnnotationExpr(); + serviceMethodAnnotation.setName("ServiceMethod"); + serviceMethodAnnotation.addPair("returns", "ReturnType.SINGLE"); + transcribeWithResponseMethod.addAnnotation(serviceMethodAnnotation); + transcribeWithResponseMethod + .setBody(parseBlock("{ TranscriptionContent requestContent = new TranscriptionContent(options); " + + "if (options.getFileDetails() != null) { requestContent.setAudio(options.getFileDetails()); } " + + "RequestOptions requestOptions = new RequestOptions(); " + "return transcribeWithResponse(" + + "new MultipartFormDataHelper(requestOptions).serializeJsonField(\"definition\", requestContent.getOptions())" + + ".serializeFileField(\"audio\", requestContent.getAudio() == null ? null : requestContent.getAudio().getContent(), " + + "requestContent.getAudio() == null ? null : requestContent.getAudio().getContentType(), " + + "requestContent.getAudio() == null ? null : requestContent.getAudio().getFilename())" + + ".end().getRequestBody(), requestOptions)" + + ".map(response -> new SimpleResponse<>(response, response.getValue().toObject(TranscriptionResult.class))); }")); + }); + }); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/pom.xml b/sdk/transcription/azure-ai-speech-transcription/pom.xml new file mode 100644 index 000000000000..95f0578d6489 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/pom.xml @@ -0,0 +1,90 @@ + + + 4.0.0 + + com.azure + azure-client-sdk-parent + 1.7.0 + ../../parents/azure-client-sdk-parent + + + com.azure + azure-ai-speech-transcription + 1.0.0-beta.2 + jar + + Microsoft Azure SDK for Transcription + This package contains Microsoft Azure Transcription client library. + https://github.com/Azure/azure-sdk-for-java + + + + The MIT License (MIT) + http://opensource.org/licenses/MIT + repo + + + + + https://github.com/Azure/azure-sdk-for-java + scm:git:git@github.com:Azure/azure-sdk-for-java.git + scm:git:git@github.com:Azure/azure-sdk-for-java.git + HEAD + + + + microsoft + Microsoft + + + + UTF-8 + + + + com.azure + azure-core + 1.57.0 + + + com.azure + azure-core-http-netty + 1.16.2 + + + com.azure + azure-core-test + 1.27.0-beta.13 + test + + + com.azure + azure-identity + 1.18.1 + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.3 + + + + + 300000 + 300000 + 300000 + + + + + + diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionAsyncClient.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionAsyncClient.java new file mode 100644 index 000000000000..69294063fad5 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionAsyncClient.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.ai.speech.transcription; + +import com.azure.ai.speech.transcription.implementation.MultipartFormDataHelper; +import com.azure.ai.speech.transcription.implementation.TranscriptionClientImpl; +import com.azure.ai.speech.transcription.models.TranscriptionContent; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the asynchronous TranscriptionClient type. + */ +@ServiceClient(builder = TranscriptionClientBuilder.class, isAsync = true) +public final class TranscriptionAsyncClient { + + private static final ClientLogger LOGGER = new ClientLogger(TranscriptionAsyncClient.class); + + @Generated + private final TranscriptionClientImpl serviceClient; + + /** + * Initializes an instance of TranscriptionAsyncClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + TranscriptionAsyncClient(TranscriptionClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Transcribes the provided audio stream. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     durationMilliseconds: int (Required)
+     *     combinedPhrases (Required): [
+     *          (Required){
+     *             channel: Integer (Optional)
+     *             text: String (Required)
+     *         }
+     *     ]
+     *     phrases (Required): [
+     *          (Required){
+     *             channel: Integer (Optional)
+     *             speaker: Integer (Optional)
+     *             offsetMilliseconds: int (Required)
+     *             durationMilliseconds: int (Required)
+     *             text: String (Required)
+     *             words (Optional): [
+     *                  (Optional){
+     *                     text: String (Required)
+     *                     offsetMilliseconds: int (Required)
+     *                     durationMilliseconds: int (Required)
+     *                 }
+     *             ]
+     *             locale: String (Optional)
+     *             confidence: double (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param body The body of the multipart request. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the result of the transcribe operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> transcribeWithResponse(BinaryData body, RequestOptions requestOptions) { + // Operation 'transcribe' is of content-type 'multipart/form-data'. Protocol API is not usable and hence not + // generated. + return this.serviceClient.transcribeWithResponseAsync(body, requestOptions); + } + + /** + * Transcribes the provided audio stream. + * + * @param body The body of the multipart request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the transcribe operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono transcribe(TranscriptionContent body) { + // Generated convenience method for transcribeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return transcribeWithResponse( + new MultipartFormDataHelper(requestOptions).serializeJsonField("definition", body.getOptions()) + .serializeFileField("audio", body.getAudio() == null ? null : body.getAudio().getContent(), + body.getAudio() == null ? null : body.getAudio().getContentType(), + body.getAudio() == null ? null : body.getAudio().getFilename()) + .end() + .getRequestBody(), + requestOptions).flatMap(FluxUtil::toMono) + .map(protocolMethodData -> protocolMethodData.toObject(TranscriptionResult.class)); + } + + /** + * Transcribes the provided audio stream with the specified options. + * + * @param options the transcription options including audio file details or audio URL + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the transcribe operation on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono transcribe(TranscriptionOptions options) { + TranscriptionContent requestContent = new TranscriptionContent(options); + if (options.getFileDetails() != null) { + requestContent.setAudio(options.getFileDetails()); + } + return transcribe(requestContent); + } + + /** + * Transcribes the provided audio stream with the specified options. + * + * @param options the transcription options including audio file details or audio URL + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing the result of the transcribe operation on successful completion of {@link Mono}. + */ + public Mono> transcribeWithResponse(TranscriptionOptions options) { + TranscriptionContent requestContent = new TranscriptionContent(options); + if (options.getFileDetails() != null) { + requestContent.setAudio(options.getFileDetails()); + } + RequestOptions requestOptions = new RequestOptions(); + return transcribeWithResponse( + new MultipartFormDataHelper(requestOptions).serializeJsonField("definition", requestContent.getOptions()) + .serializeFileField("audio", + requestContent.getAudio() == null ? null : requestContent.getAudio().getContent(), + requestContent.getAudio() == null ? null : requestContent.getAudio().getContentType(), + requestContent.getAudio() == null ? null : requestContent.getAudio().getFilename()) + .end() + .getRequestBody(), + requestOptions).map( + response -> new SimpleResponse<>(response, response.getValue().toObject(TranscriptionResult.class))); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionClient.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionClient.java new file mode 100644 index 000000000000..42a6fa24db7c --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionClient.java @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.implementation.MultipartFormDataHelper; +import com.azure.ai.speech.transcription.implementation.TranscriptionClientImpl; +import com.azure.ai.speech.transcription.models.TranscriptionContent; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceClient; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.BinaryData; +import com.azure.core.util.logging.ClientLogger; + +/** + * Initializes a new instance of the synchronous TranscriptionClient type. + */ +@ServiceClient(builder = TranscriptionClientBuilder.class) +public final class TranscriptionClient { + + private static final ClientLogger LOGGER = new ClientLogger(TranscriptionClient.class); + + @Generated + private final TranscriptionClientImpl serviceClient; + + /** + * Initializes an instance of TranscriptionClient class. + * + * @param serviceClient the service client implementation. + */ + @Generated + TranscriptionClient(TranscriptionClientImpl serviceClient) { + this.serviceClient = serviceClient; + } + + /** + * Transcribes the provided audio stream. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     durationMilliseconds: int (Required)
+     *     combinedPhrases (Required): [
+     *          (Required){
+     *             channel: Integer (Optional)
+     *             text: String (Required)
+     *         }
+     *     ]
+     *     phrases (Required): [
+     *          (Required){
+     *             channel: Integer (Optional)
+     *             speaker: Integer (Optional)
+     *             offsetMilliseconds: int (Required)
+     *             durationMilliseconds: int (Required)
+     *             text: String (Required)
+     *             words (Optional): [
+     *                  (Optional){
+     *                     text: String (Required)
+     *                     offsetMilliseconds: int (Required)
+     *                     durationMilliseconds: int (Required)
+     *                 }
+     *             ]
+     *             locale: String (Optional)
+     *             confidence: double (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param body The body of the multipart request. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the result of the transcribe operation along with {@link Response}. + */ + @Generated + @ServiceMethod(returns = ReturnType.SINGLE) + Response transcribeWithResponse(BinaryData body, RequestOptions requestOptions) { + // Operation 'transcribe' is of content-type 'multipart/form-data'. Protocol API is not usable and hence not + // generated. + return this.serviceClient.transcribeWithResponse(body, requestOptions); + } + + /** + * Transcribes the provided audio stream. + * + * @param body The body of the multipart request. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the transcribe operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TranscriptionResult transcribe(TranscriptionContent body) { + // Generated convenience method for transcribeWithResponse + RequestOptions requestOptions = new RequestOptions(); + return transcribeWithResponse( + new MultipartFormDataHelper(requestOptions).serializeJsonField("definition", body.getOptions()) + .serializeFileField("audio", body.getAudio() == null ? null : body.getAudio().getContent(), + body.getAudio() == null ? null : body.getAudio().getContentType(), + body.getAudio() == null ? null : body.getAudio().getFilename()) + .end() + .getRequestBody(), + requestOptions).getValue().toObject(TranscriptionResult.class); + } + + /** + * Transcribes the provided audio stream with the specified options. + * + * @param options the transcription options including audio file details or audio URL + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the result of the transcribe operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TranscriptionResult transcribe(TranscriptionOptions options) { + TranscriptionContent requestContent = new TranscriptionContent(options); + if (options.getFileDetails() != null) { + requestContent.setAudio(options.getFileDetails()); + } + return transcribe(requestContent); + } + + /** + * Transcribes the provided audio stream with the specified options. + * + * @param options the transcription options including audio file details or audio URL + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response containing the result of the transcribe operation. + */ + public Response transcribeWithResponse(TranscriptionOptions options) { + TranscriptionContent requestContent = new TranscriptionContent(options); + if (options.getFileDetails() != null) { + requestContent.setAudio(options.getFileDetails()); + } + RequestOptions requestOptions = new RequestOptions(); + Response response = transcribeWithResponse( + new MultipartFormDataHelper(requestOptions).serializeJsonField("definition", requestContent.getOptions()) + .serializeFileField("audio", + requestContent.getAudio() == null ? null : requestContent.getAudio().getContent(), + requestContent.getAudio() == null ? null : requestContent.getAudio().getContentType(), + requestContent.getAudio() == null ? null : requestContent.getAudio().getFilename()) + .end() + .getRequestBody(), + requestOptions); + return new SimpleResponse<>(response, response.getValue().toObject(TranscriptionResult.class)); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionClientBuilder.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionClientBuilder.java new file mode 100644 index 000000000000..649d0f6ca0d8 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionClientBuilder.java @@ -0,0 +1,356 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.implementation.TranscriptionClientImpl; +import com.azure.core.annotation.Generated; +import com.azure.core.annotation.ServiceClientBuilder; +import com.azure.core.client.traits.ConfigurationTrait; +import com.azure.core.client.traits.EndpointTrait; +import com.azure.core.client.traits.HttpTrait; +import com.azure.core.client.traits.KeyCredentialTrait; +import com.azure.core.client.traits.TokenCredentialTrait; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpClient; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; +import com.azure.core.http.policy.AddDatePolicy; +import com.azure.core.http.policy.AddHeadersFromContextPolicy; +import com.azure.core.http.policy.AddHeadersPolicy; +import com.azure.core.http.policy.BearerTokenAuthenticationPolicy; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.HttpLoggingPolicy; +import com.azure.core.http.policy.HttpPipelinePolicy; +import com.azure.core.http.policy.HttpPolicyProviders; +import com.azure.core.http.policy.KeyCredentialPolicy; +import com.azure.core.http.policy.RequestIdPolicy; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.util.ClientOptions; +import com.azure.core.util.Configuration; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.builder.ClientBuilderUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.core.util.serializer.JacksonAdapter; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * A builder for creating a new instance of the TranscriptionClient type. + */ +@ServiceClientBuilder(serviceClients = { TranscriptionClient.class, TranscriptionAsyncClient.class }) +public final class TranscriptionClientBuilder implements HttpTrait, + ConfigurationTrait, TokenCredentialTrait, + KeyCredentialTrait, EndpointTrait { + + @Generated + private static final String SDK_NAME = "name"; + + @Generated + private static final String SDK_VERSION = "version"; + + @Generated + private static final Map PROPERTIES + = CoreUtils.getProperties("azure-ai-speech-transcription.properties"); + + @Generated + private final List pipelinePolicies; + + /** + * Create an instance of the TranscriptionClientBuilder. + */ + @Generated + public TranscriptionClientBuilder() { + this.pipelinePolicies = new ArrayList<>(); + } + + /* + * The HTTP client used to send the request. + */ + @Generated + private HttpClient httpClient; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder httpClient(HttpClient httpClient) { + this.httpClient = httpClient; + return this; + } + + /* + * The HTTP pipeline to send requests through. + */ + @Generated + private HttpPipeline pipeline; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder pipeline(HttpPipeline pipeline) { + if (this.pipeline != null && pipeline == null) { + LOGGER.atInfo().log("HttpPipeline is being set to 'null' when it was previously configured."); + } + this.pipeline = pipeline; + return this; + } + + /* + * The logging configuration for HTTP requests and responses. + */ + @Generated + private HttpLogOptions httpLogOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder httpLogOptions(HttpLogOptions httpLogOptions) { + this.httpLogOptions = httpLogOptions; + return this; + } + + /* + * The client options such as application ID and custom headers to set on a request. + */ + @Generated + private ClientOptions clientOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder clientOptions(ClientOptions clientOptions) { + this.clientOptions = clientOptions; + return this; + } + + /* + * The retry options to configure retry policy for failed requests. + */ + @Generated + private RetryOptions retryOptions; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder retryOptions(RetryOptions retryOptions) { + this.retryOptions = retryOptions; + return this; + } + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder addPolicy(HttpPipelinePolicy customPolicy) { + Objects.requireNonNull(customPolicy, "'customPolicy' cannot be null."); + pipelinePolicies.add(customPolicy); + return this; + } + + /* + * The configuration store that is used during construction of the service client. + */ + @Generated + private Configuration configuration; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder configuration(Configuration configuration) { + this.configuration = configuration; + return this; + } + + /* + * The KeyCredential used for authentication. + */ + @Generated + private KeyCredential keyCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder credential(KeyCredential keyCredential) { + this.keyCredential = keyCredential; + return this; + } + + /* + * The service endpoint + */ + @Generated + private String endpoint; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; + return this; + } + + /* + * Service version + */ + @Generated + private TranscriptionServiceVersion serviceVersion; + + /** + * Sets Service version. + * + * @param serviceVersion the serviceVersion value. + * @return the TranscriptionClientBuilder. + */ + @Generated + public TranscriptionClientBuilder serviceVersion(TranscriptionServiceVersion serviceVersion) { + this.serviceVersion = serviceVersion; + return this; + } + + /* + * The retry policy that will attempt to retry failed requests, if applicable. + */ + @Generated + private RetryPolicy retryPolicy; + + /** + * Sets The retry policy that will attempt to retry failed requests, if applicable. + * + * @param retryPolicy the retryPolicy value. + * @return the TranscriptionClientBuilder. + */ + @Generated + public TranscriptionClientBuilder retryPolicy(RetryPolicy retryPolicy) { + this.retryPolicy = retryPolicy; + return this; + } + + /** + * Builds an instance of TranscriptionClientImpl with the provided parameters. + * + * @return an instance of TranscriptionClientImpl. + */ + @Generated + private TranscriptionClientImpl buildInnerClient() { + this.validateClient(); + HttpPipeline localPipeline = (pipeline != null) ? pipeline : createHttpPipeline(); + TranscriptionServiceVersion localServiceVersion + = (serviceVersion != null) ? serviceVersion : TranscriptionServiceVersion.getLatest(); + TranscriptionClientImpl client = new TranscriptionClientImpl(localPipeline, + JacksonAdapter.createDefaultSerializerAdapter(), this.endpoint, localServiceVersion); + return client; + } + + @Generated + private void validateClient() { + // This method is invoked from 'buildInnerClient'/'buildClient' method. + // Developer can customize this method, to validate that the necessary conditions are met for the new client. + Objects.requireNonNull(endpoint, "'endpoint' cannot be null."); + } + + @Generated + private HttpPipeline createHttpPipeline() { + Configuration buildConfiguration + = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration; + HttpLogOptions localHttpLogOptions = this.httpLogOptions == null ? new HttpLogOptions() : this.httpLogOptions; + ClientOptions localClientOptions = this.clientOptions == null ? new ClientOptions() : this.clientOptions; + List policies = new ArrayList<>(); + String clientName = PROPERTIES.getOrDefault(SDK_NAME, "UnknownName"); + String clientVersion = PROPERTIES.getOrDefault(SDK_VERSION, "UnknownVersion"); + String applicationId = CoreUtils.getApplicationId(localClientOptions, localHttpLogOptions); + policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration)); + policies.add(new RequestIdPolicy()); + policies.add(new AddHeadersFromContextPolicy()); + HttpHeaders headers = CoreUtils.createHttpHeadersFromClientOptions(localClientOptions); + if (headers != null) { + policies.add(new AddHeadersPolicy(headers)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addBeforeRetryPolicies(policies); + policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy())); + policies.add(new AddDatePolicy()); + if (keyCredential != null) { + policies.add(new KeyCredentialPolicy("Ocp-Apim-Subscription-Key", keyCredential)); + } + if (tokenCredential != null) { + policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES)); + } + this.pipelinePolicies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .forEach(p -> policies.add(p)); + HttpPolicyProviders.addAfterRetryPolicies(policies); + policies.add(new HttpLoggingPolicy(localHttpLogOptions)); + HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])) + .httpClient(httpClient) + .clientOptions(localClientOptions) + .build(); + return httpPipeline; + } + + /** + * Builds an instance of TranscriptionAsyncClient class. + * + * @return an instance of TranscriptionAsyncClient. + */ + @Generated + public TranscriptionAsyncClient buildAsyncClient() { + return new TranscriptionAsyncClient(buildInnerClient()); + } + + /** + * Builds an instance of TranscriptionClient class. + * + * @return an instance of TranscriptionClient. + */ + @Generated + public TranscriptionClient buildClient() { + return new TranscriptionClient(buildInnerClient()); + } + + private static final ClientLogger LOGGER = new ClientLogger(TranscriptionClientBuilder.class); + + @Generated + private static final String[] DEFAULT_SCOPES = new String[] { "https://cognitiveservices.azure.com/.default" }; + + /* + * The TokenCredential used for authentication. + */ + @Generated + private TokenCredential tokenCredential; + + /** + * {@inheritDoc}. + */ + @Generated + @Override + public TranscriptionClientBuilder credential(TokenCredential tokenCredential) { + this.tokenCredential = tokenCredential; + return this; + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionServiceVersion.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionServiceVersion.java new file mode 100644 index 000000000000..07e1561ff2f4 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/TranscriptionServiceVersion.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.ai.speech.transcription; + +import com.azure.core.util.ServiceVersion; + +/** + * Service version of TranscriptionClient. + */ +public enum TranscriptionServiceVersion implements ServiceVersion { + /** + * Enum value 2025-10-15. + */ + V2025_10_15("2025-10-15"); + + private final String version; + + TranscriptionServiceVersion(String version) { + this.version = version; + } + + /** + * {@inheritDoc} + */ + @Override + public String getVersion() { + return this.version; + } + + /** + * Gets the latest service version supported by this client library. + * + * @return The latest {@link TranscriptionServiceVersion}. + */ + public static TranscriptionServiceVersion getLatest() { + return V2025_10_15; + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/implementation/MultipartFormDataHelper.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/implementation/MultipartFormDataHelper.java new file mode 100644 index 000000000000..2a2962e1595d --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/implementation/MultipartFormDataHelper.java @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.speech.transcription.implementation; + +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import com.azure.core.util.CoreUtils; +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.SequenceInputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.List; +import java.util.UUID; + +// DO NOT modify this helper class + +public final class MultipartFormDataHelper { + /** + * Line separator for the multipart HTTP request. + */ + private static final String CRLF = "\r\n"; + + private static final String APPLICATION_OCTET_STREAM = "application/octet-stream"; + + /** + * Value to be used as part of the divider for the multipart requests. + */ + private final String boundary; + + /** + * The actual part separator in the request. This is obtained by prepending "--" to the "boundary". + */ + private final String partSeparator; + + /** + * The marker for the ending of a multipart request. This is obtained by post-pending "--" to the "partSeparator". + */ + private final String endMarker; + + /** + * Charset used for encoding the multipart HTTP request. + */ + private final Charset encoderCharset = StandardCharsets.UTF_8; + + private InputStream requestDataStream = new ByteArrayInputStream(new byte[0]); + private long requestLength = 0; + + private RequestOptions requestOptions; + private BinaryData requestBody; + + /** + * Default constructor used in the code. The boundary is a random value. + * + * @param requestOptions the RequestOptions to update + */ + public MultipartFormDataHelper(RequestOptions requestOptions) { + this(requestOptions, UUID.randomUUID().toString().substring(0, 16)); + } + + private MultipartFormDataHelper(RequestOptions requestOptions, String boundary) { + this.requestOptions = requestOptions; + this.boundary = boundary; + this.partSeparator = "--" + boundary; + this.endMarker = this.partSeparator + "--"; + } + + /** + * Gets the multipart HTTP request body. + * + * @return the BinaryData of the multipart HTTP request body + */ + public BinaryData getRequestBody() { + return requestBody; + } + + // text/plain + /** + * Formats a text/plain field for a multipart HTTP request. + * + * @param fieldName the field name + * @param value the value of the text/plain field + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeTextField(String fieldName, String value) { + if (value != null) { + String serialized = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + + "\"" + CRLF + CRLF + value + CRLF; + byte[] data = serialized.getBytes(encoderCharset); + appendBytes(data); + } + return this; + } + + // application/json + /** + * Formats a application/json field for a multipart HTTP request. + * + * @param fieldName the field name + * @param jsonObject the object of the application/json field + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeJsonField(String fieldName, Object jsonObject) { + if (jsonObject != null) { + String serialized + = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + "\"" + CRLF + + "Content-Type: application/json" + CRLF + CRLF + BinaryData.fromObject(jsonObject) + CRLF; + byte[] data = serialized.getBytes(encoderCharset); + appendBytes(data); + } + return this; + } + + /** + * Formats a file field for a multipart HTTP request. + * + * @param fieldName the field name + * @param file the BinaryData of the file + * @param contentType the content-type of the file + * @param filename the filename + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeFileField(String fieldName, BinaryData file, String contentType, + String filename) { + if (file != null) { + if (CoreUtils.isNullOrEmpty(contentType)) { + contentType = APPLICATION_OCTET_STREAM; + } + writeFileField(fieldName, file, contentType, filename); + } + return this; + } + + /** + * Formats a file field (potentially multiple files) for a multipart HTTP request. + * + * @param fieldName the field name + * @param files the List of BinaryData of the files + * @param contentTypes the List of content-type of the files + * @param filenames the List of filenames + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper serializeFileFields(String fieldName, List files, + List contentTypes, List filenames) { + if (files != null) { + for (int i = 0; i < files.size(); ++i) { + BinaryData file = files.get(i); + String contentType = contentTypes.get(i); + if (CoreUtils.isNullOrEmpty(contentType)) { + contentType = APPLICATION_OCTET_STREAM; + } + String filename = filenames.get(i); + writeFileField(fieldName, file, contentType, filename); + } + } + return this; + } + + /** + * Ends the serialization of the multipart HTTP request. + * + * @return the MultipartFormDataHelper instance + */ + public MultipartFormDataHelper end() { + byte[] data = endMarker.getBytes(encoderCharset); + appendBytes(data); + + requestBody = BinaryData.fromStream(requestDataStream, requestLength); + + requestOptions.setHeader(HttpHeaderName.CONTENT_TYPE, "multipart/form-data; boundary=" + this.boundary) + .setHeader(HttpHeaderName.CONTENT_LENGTH, String.valueOf(requestLength)); + + return this; + } + + private void writeFileField(String fieldName, BinaryData file, String contentType, String filename) { + String contentDispositionFilename = ""; + if (!CoreUtils.isNullOrEmpty(filename)) { + contentDispositionFilename = "; filename=\"" + escapeName(filename) + "\""; + } + + // Multipart preamble + String fileFieldPreamble + = partSeparator + CRLF + "Content-Disposition: form-data; name=\"" + escapeName(fieldName) + "\"" + + contentDispositionFilename + CRLF + "Content-Type: " + contentType + CRLF + CRLF; + byte[] data = fileFieldPreamble.getBytes(encoderCharset); + appendBytes(data); + + // Writing the file into the request as a byte stream + requestLength += file.getLength(); + requestDataStream = new SequenceInputStream(requestDataStream, file.toStream()); + + // CRLF + data = CRLF.getBytes(encoderCharset); + appendBytes(data); + } + + private void appendBytes(byte[] bytes) { + requestLength += bytes.length; + requestDataStream = new SequenceInputStream(requestDataStream, new ByteArrayInputStream(bytes)); + } + + private static String escapeName(String name) { + return name.replace("\n", "%0A").replace("\r", "%0D").replace("\"", "%22"); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/implementation/TranscriptionClientImpl.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/implementation/TranscriptionClientImpl.java new file mode 100644 index 000000000000..5e57b77e911b --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/implementation/TranscriptionClientImpl.java @@ -0,0 +1,284 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.ai.speech.transcription.implementation; + +import com.azure.ai.speech.transcription.TranscriptionServiceVersion; +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.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.exception.ClientAuthenticationException; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.exception.ResourceModifiedException; +import com.azure.core.exception.ResourceNotFoundException; +import com.azure.core.http.HttpPipeline; +import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.policy.RetryPolicy; +import com.azure.core.http.policy.UserAgentPolicy; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.serializer.JacksonAdapter; +import com.azure.core.util.serializer.SerializerAdapter; +import reactor.core.publisher.Mono; + +/** + * Initializes a new instance of the TranscriptionClient type. + */ +public final class TranscriptionClientImpl { + /** + * The proxy service used to perform REST calls. + */ + private final TranscriptionClientService service; + + /** + * Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + */ + private final String endpoint; + + /** + * Gets Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + * + * @return the endpoint value. + */ + public String getEndpoint() { + return this.endpoint; + } + + /** + * Service version. + */ + private final TranscriptionServiceVersion serviceVersion; + + /** + * Gets Service version. + * + * @return the serviceVersion value. + */ + public TranscriptionServiceVersion getServiceVersion() { + return this.serviceVersion; + } + + /** + * The HTTP pipeline to send requests through. + */ + private final HttpPipeline httpPipeline; + + /** + * Gets The HTTP pipeline to send requests through. + * + * @return the httpPipeline value. + */ + public HttpPipeline getHttpPipeline() { + return this.httpPipeline; + } + + /** + * The serializer to serialize an object into a string. + */ + private final SerializerAdapter serializerAdapter; + + /** + * Gets The serializer to serialize an object into a string. + * + * @return the serializerAdapter value. + */ + public SerializerAdapter getSerializerAdapter() { + return this.serializerAdapter; + } + + /** + * Initializes an instance of TranscriptionClient client. + * + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + * @param serviceVersion Service version. + */ + public TranscriptionClientImpl(String endpoint, TranscriptionServiceVersion serviceVersion) { + this(new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(), + JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of TranscriptionClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + * @param serviceVersion Service version. + */ + public TranscriptionClientImpl(HttpPipeline httpPipeline, String endpoint, + TranscriptionServiceVersion serviceVersion) { + this(httpPipeline, JacksonAdapter.createDefaultSerializerAdapter(), endpoint, serviceVersion); + } + + /** + * Initializes an instance of TranscriptionClient client. + * + * @param httpPipeline The HTTP pipeline to send requests through. + * @param serializerAdapter The serializer to serialize an object into a string. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + * @param serviceVersion Service version. + */ + public TranscriptionClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, String endpoint, + TranscriptionServiceVersion serviceVersion) { + this.httpPipeline = httpPipeline; + this.serializerAdapter = serializerAdapter; + this.endpoint = endpoint; + this.serviceVersion = serviceVersion; + this.service + = RestProxy.create(TranscriptionClientService.class, this.httpPipeline, this.getSerializerAdapter()); + } + + /** + * The interface defining all the services for TranscriptionClient to be used by the proxy service to perform REST + * calls. + */ + @Host("{endpoint}/speechtotext") + @ServiceInterface(name = "TranscriptionClient") + public interface TranscriptionClientService { + // @Multipart not supported by RestProxy + @Post("/transcriptions:transcribe") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Mono> transcribe(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + + // @Multipart not supported by RestProxy + @Post("/transcriptions:transcribe") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 }) + @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 }) + @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 }) + @UnexpectedResponseExceptionType(HttpResponseException.class) + Response transcribeSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("content-type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("multipart/form-data") BinaryData body, + RequestOptions requestOptions, Context context); + } + + /** + * Transcribes the provided audio stream. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     durationMilliseconds: int (Required)
+     *     combinedPhrases (Required): [
+     *          (Required){
+     *             channel: Integer (Optional)
+     *             text: String (Required)
+     *         }
+     *     ]
+     *     phrases (Required): [
+     *          (Required){
+     *             channel: Integer (Optional)
+     *             speaker: Integer (Optional)
+     *             offsetMilliseconds: int (Required)
+     *             durationMilliseconds: int (Required)
+     *             text: String (Required)
+     *             words (Optional): [
+     *                  (Optional){
+     *                     text: String (Required)
+     *                     offsetMilliseconds: int (Required)
+     *                     durationMilliseconds: int (Required)
+     *                 }
+     *             ]
+     *             locale: String (Optional)
+     *             confidence: double (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param body The body of the multipart request. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the result of the transcribe operation along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> transcribeWithResponseAsync(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.transcribe(this.getEndpoint(), + this.getServiceVersion().getVersion(), contentType, accept, body, requestOptions, context)); + } + + /** + * Transcribes the provided audio stream. + *

Response Body Schema

+ * + *
+     * {@code
+     * {
+     *     durationMilliseconds: int (Required)
+     *     combinedPhrases (Required): [
+     *          (Required){
+     *             channel: Integer (Optional)
+     *             text: String (Required)
+     *         }
+     *     ]
+     *     phrases (Required): [
+     *          (Required){
+     *             channel: Integer (Optional)
+     *             speaker: Integer (Optional)
+     *             offsetMilliseconds: int (Required)
+     *             durationMilliseconds: int (Required)
+     *             text: String (Required)
+     *             words (Optional): [
+     *                  (Optional){
+     *                     text: String (Required)
+     *                     offsetMilliseconds: int (Required)
+     *                     durationMilliseconds: int (Required)
+     *                 }
+     *             ]
+     *             locale: String (Optional)
+     *             confidence: double (Required)
+     *         }
+     *     ]
+     * }
+     * }
+     * 
+ * + * @param body The body of the multipart request. + * @param requestOptions The options to configure the HTTP request before HTTP client sends it. + * @throws HttpResponseException thrown if the request is rejected by server. + * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401. + * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404. + * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409. + * @return the result of the transcribe operation along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response transcribeWithResponse(BinaryData body, RequestOptions requestOptions) { + final String contentType = "multipart/form-data"; + final String accept = "application/json"; + return service.transcribeSync(this.getEndpoint(), this.getServiceVersion().getVersion(), contentType, accept, + body, requestOptions, Context.NONE); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/implementation/package-info.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/implementation/package-info.java new file mode 100644 index 000000000000..140636afd3d6 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/implementation/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +/** + * + * Package containing the implementations for Transcription. + * + */ +package com.azure.ai.speech.transcription.implementation; diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/AudioFileDetails.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/AudioFileDetails.java new file mode 100644 index 000000000000..7381bc25899d --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/AudioFileDetails.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +import com.azure.core.util.BinaryData; + +/** + * The file details for the "audio" field. + */ +@Fluent +public final class AudioFileDetails { + + /* + * The content of the file. + */ + @Generated + private final BinaryData content; + + /* + * The filename of the file. + */ + @Generated + private String filename; + + /* + * The content-type of the file. + */ + @Generated + private String contentType = "application/octet-stream"; + + /** + * Creates an instance of AudioFileDetails class. + * + * @param content the content value to set. + */ + @Generated + public AudioFileDetails(BinaryData content) { + this.content = content; + } + + /** + * Get the content property: The content of the file. + * + * @return the content value. + */ + @Generated + public BinaryData getContent() { + return this.content; + } + + /** + * Get the filename property: The filename of the file. If not explicitly set, a filename will be auto-generated + * from the contentType. + * + * @return the filename value, or an auto-generated filename if not set. + */ + @Generated + public String getFilename() { + if (this.filename != null && !this.filename.isEmpty()) { + return this.filename; + } + if ("audio/wav".equalsIgnoreCase(this.contentType)) { + return "audio.wav"; + } + if ("audio/mpeg".equalsIgnoreCase(this.contentType) || "audio/mp3".equalsIgnoreCase(this.contentType)) { + return "audio.mp3"; + } + if ("audio/ogg".equalsIgnoreCase(this.contentType)) { + return "audio.ogg"; + } + if ("audio/flac".equalsIgnoreCase(this.contentType)) { + return "audio.flac"; + } + if ("audio/webm".equalsIgnoreCase(this.contentType)) { + return "audio.webm"; + } + if ("audio/opus".equalsIgnoreCase(this.contentType)) { + return "audio.opus"; + } + return "audio"; + } + + /** + * Set the filename property: The filename of the file. + * + * @param filename the filename value to set. + * @return the AudioFileDetails object itself. + */ + @Generated + public AudioFileDetails setFilename(String filename) { + this.filename = filename; + return this; + } + + /** + * Get the contentType property: The content-type of the file. + * + * @return the contentType value. + */ + @Generated + public String getContentType() { + return this.contentType; + } + + /** + * Set the contentType property: The content-type of the file. + * + * @param contentType the contentType value to set. + * @return the AudioFileDetails object itself. + */ + @Generated + public AudioFileDetails setContentType(String contentType) { + this.contentType = contentType; + return this; + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/ChannelCombinedPhrases.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/ChannelCombinedPhrases.java new file mode 100644 index 000000000000..a315b684bc4c --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/ChannelCombinedPhrases.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription.models; + +import com.azure.core.annotation.Generated; +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 full transcript per channel. + */ +@Immutable +public final class ChannelCombinedPhrases implements JsonSerializable { + + /* + * The 0-based channel index. Only present if channel separation is enabled. + */ + @Generated + private Integer channel; + + /* + * The complete transcribed text for the channel. + */ + @Generated + private final String text; + + /** + * Creates an instance of ChannelCombinedPhrases class. + * + * @param text the text value to set. + */ + @Generated + private ChannelCombinedPhrases(String text) { + this.text = text; + } + + /** + * Get the channel property: The 0-based channel index. Only present if channel separation is enabled. + * + * @return the channel value. + */ + @Generated + public Integer getChannel() { + return this.channel; + } + + /** + * Get the text property: The complete transcribed text for the channel. + * + * @return the text value. + */ + @Generated + public String getText() { + return this.text; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("text", this.text); + jsonWriter.writeNumberField("channel", this.channel); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChannelCombinedPhrases from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChannelCombinedPhrases 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 ChannelCombinedPhrases. + */ + @Generated + public static ChannelCombinedPhrases fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String text = null; + Integer channel = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("text".equals(fieldName)) { + text = reader.getString(); + } else if ("channel".equals(fieldName)) { + channel = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + ChannelCombinedPhrases deserializedChannelCombinedPhrases = new ChannelCombinedPhrases(text); + deserializedChannelCombinedPhrases.channel = channel; + return deserializedChannelCombinedPhrases; + }); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/EnhancedModeOptions.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/EnhancedModeOptions.java new file mode 100644 index 000000000000..d013f508bb8e --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/EnhancedModeOptions.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.ai.speech.transcription.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +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; + +/** + * Enhanced mode properties for transcription. + */ +@Fluent +public final class EnhancedModeOptions implements JsonSerializable { + + /* + * Enable enhanced mode for transcription. This is automatically set to true when task, targetLanguage, or prompt + * are specified. + */ + @Generated + private Boolean enabled; + + /* + * Task type for enhanced mode. + */ + @Generated + private String task; + + /* + * Target language for enhanced mode. + */ + @Generated + private String targetLanguage; + + /* + * A list of user prompts. + */ + @Generated + private List prompts; + + /** + * Creates an instance of EnhancedModeOptions class with enabled set to true. + */ + public EnhancedModeOptions() { + this.enabled = true; + } + + /** + * Get the task property: Task type for enhanced mode. + * + * @return the task value. + */ + @Generated + public String getTask() { + return this.task; + } + + /** + * Set the task property: Task type for enhanced mode. + * + * @param task the task value to set. + * @return the EnhancedModeOptions object itself. + */ + @Generated + public EnhancedModeOptions setTask(String task) { + this.task = task; + return this; + } + + /** + * Get the targetLanguage property: Target language for enhanced mode. + * + * @return the targetLanguage value. + */ + @Generated + public String getTargetLanguage() { + return this.targetLanguage; + } + + /** + * Set the targetLanguage property: Target language for enhanced mode. + * + * @param targetLanguage the targetLanguage value to set. + * @return the EnhancedModeOptions object itself. + */ + @Generated + public EnhancedModeOptions setTargetLanguage(String targetLanguage) { + this.targetLanguage = targetLanguage; + return this; + } + + /** + * Get the prompts property: A list of user prompts. + * + * @return the prompts value. + */ + @Generated + public List getPrompts() { + return this.prompts; + } + + /** + * Set the prompts property: A list of user prompts. + * + * @param prompts the prompts value to set. + * @return the EnhancedModeOptions object itself. + */ + @Generated + public EnhancedModeOptions setPrompts(List prompts) { + this.prompts = prompts; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("task", this.task); + jsonWriter.writeStringField("targetLanguage", this.targetLanguage); + jsonWriter.writeArrayField("prompt", this.prompts, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of EnhancedModeOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of EnhancedModeOptions 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 EnhancedModeOptions. + */ + @Generated + public static EnhancedModeOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + EnhancedModeOptions deserializedEnhancedModeOptions = new EnhancedModeOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("enabled".equals(fieldName)) { + deserializedEnhancedModeOptions.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("task".equals(fieldName)) { + deserializedEnhancedModeOptions.task = reader.getString(); + } else if ("targetLanguage".equals(fieldName)) { + deserializedEnhancedModeOptions.targetLanguage = reader.getString(); + } else if ("prompt".equals(fieldName)) { + List prompts = reader.readArray(reader1 -> reader1.getString()); + deserializedEnhancedModeOptions.prompts = prompts; + } else { + reader.skipChildren(); + } + } + return deserializedEnhancedModeOptions; + }); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/PhraseListOptions.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/PhraseListOptions.java new file mode 100644 index 000000000000..e269745eaf87 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/PhraseListOptions.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +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; + +/** + * Phrase list properties for transcription. + */ +@Fluent +public final class PhraseListOptions implements JsonSerializable { + + /* + * List of phrases for recognition. + */ + @Generated + private List phrases; + + /* + * Biasing weight for phrase list (1.0 to 20.0). + */ + @Generated + private Double biasingWeight; + + /** + * Creates an instance of PhraseListOptions class. + */ + @Generated + public PhraseListOptions() { + } + + /** + * Get the phrases property: List of phrases for recognition. + * + * @return the phrases value. + */ + @Generated + public List getPhrases() { + return this.phrases; + } + + /** + * Set the phrases property: List of phrases for recognition. + * + * @param phrases the phrases value to set. + * @return the PhraseListOptions object itself. + */ + @Generated + public PhraseListOptions setPhrases(List phrases) { + this.phrases = phrases; + return this; + } + + /** + * Get the biasingWeight property: Biasing weight for phrase list (1.0 to 20.0). + * + * @return the biasingWeight value. + */ + @Generated + public Double getBiasingWeight() { + return this.biasingWeight; + } + + /** + * Set the biasingWeight property: Biasing weight for phrase list (1.0 to 20.0). + * + * @param biasingWeight the biasingWeight value to set. + * @return the PhraseListOptions object itself. + */ + @Generated + public PhraseListOptions setBiasingWeight(Double biasingWeight) { + this.biasingWeight = biasingWeight; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("phrases", this.phrases, (writer, element) -> writer.writeString(element)); + jsonWriter.writeNumberField("biasingWeight", this.biasingWeight); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhraseListOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhraseListOptions 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 PhraseListOptions. + */ + @Generated + public static PhraseListOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhraseListOptions deserializedPhraseListOptions = new PhraseListOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("phrases".equals(fieldName)) { + List phrases = reader.readArray(reader1 -> reader1.getString()); + deserializedPhraseListOptions.phrases = phrases; + } else if ("biasingWeight".equals(fieldName)) { + deserializedPhraseListOptions.biasingWeight = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + return deserializedPhraseListOptions; + }); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/ProfanityFilterMode.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/ProfanityFilterMode.java new file mode 100644 index 000000000000..8031bcadc6ae --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/ProfanityFilterMode.java @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription.models; + +import com.azure.core.annotation.Generated; +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of profanity filtering. + */ +public final class ProfanityFilterMode extends ExpandableStringEnum { + + /** + * Disable profanity filtering. + */ + @Generated + public static final ProfanityFilterMode NONE = fromString("None"); + + /** + * Remove profanity. + */ + @Generated + public static final ProfanityFilterMode REMOVED = fromString("Removed"); + + /** + * Add "profanity" XML tags</Profanity>. + */ + @Generated + public static final ProfanityFilterMode TAGS = fromString("Tags"); + + /** + * Mask the profanity with * except of the first letter, e.g., f***. + */ + @Generated + public static final ProfanityFilterMode MASKED = fromString("Masked"); + + /** + * Creates a new instance of ProfanityFilterMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Generated + @Deprecated + public ProfanityFilterMode() { + } + + /** + * Creates or finds a ProfanityFilterMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ProfanityFilterMode. + */ + @Generated + public static ProfanityFilterMode fromString(String name) { + return fromString(name, ProfanityFilterMode.class); + } + + /** + * Gets known ProfanityFilterMode values. + * + * @return known ProfanityFilterMode values. + */ + @Generated + public static Collection values() { + return values(ProfanityFilterMode.class); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscribedPhrase.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscribedPhrase.java new file mode 100644 index 000000000000..6406e29ed530 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscribedPhrase.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription.models; + +import com.azure.core.annotation.Generated; +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; +import java.time.Duration; +import java.util.List; + +/** + * A transcribed phrase. + */ +@Immutable +public final class TranscribedPhrase implements JsonSerializable { + + /* + * The 0-based channel index. Only present if channel separation is enabled. + */ + @Generated + private Integer channel; + + /* + * A unique integer number that is assigned to each speaker detected in the audio without particular order. Only + * present if speaker diarization is enabled. + */ + @Generated + private Integer speaker; + + /* + * The start offset of the phrase in milliseconds. + */ + @Generated + private final int offset; + + /* + * The duration of the phrase in milliseconds. + */ + @Generated + private final int duration; + + /* + * The transcribed text of the phrase. + */ + @Generated + private final String text; + + /* + * The words that make up the phrase. Only present if word-level timestamps are enabled. + */ + @Generated + private List words; + + /* + * The locale of the phrase. + */ + @Generated + private String locale; + + /* + * The confidence value for the phrase. + */ + @Generated + private final double confidence; + + /** + * Creates an instance of TranscribedPhrase class. + * + * @param offset the offset value to set. + * @param duration the duration value to set. + * @param text the text value to set. + * @param confidence the confidence value to set. + */ + @Generated + private TranscribedPhrase(int offset, int duration, String text, double confidence) { + this.offset = offset; + this.duration = duration; + this.text = text; + this.confidence = confidence; + } + + /** + * Get the channel property: The 0-based channel index. Only present if channel separation is enabled. + * + * @return the channel value. + */ + @Generated + public Integer getChannel() { + return this.channel; + } + + /** + * Get the speaker property: A unique integer number that is assigned to each speaker detected in the audio without + * particular order. Only present if speaker diarization is enabled. + * + * @return the speaker value. + */ + @Generated + public Integer getSpeaker() { + return this.speaker; + } + + /** + * Get the offset property: The start offset of the phrase in milliseconds. + * + * @return the offset value. + */ + @Generated + public int getOffset() { + return this.offset; + } + + /** + * Get the duration property: The duration in milliseconds. + * + * @return the duration value as Duration. + */ + @Generated + public Duration getDuration() { + return Duration.ofMillis(this.duration); + } + + /** + * Get the text property: The transcribed text of the phrase. + * + * @return the text value. + */ + @Generated + public String getText() { + return this.text; + } + + /** + * Get the words property: The words that make up the phrase. Only present if word-level timestamps are enabled. + * + * @return the words value. + */ + @Generated + public List getWords() { + return this.words; + } + + /** + * Get the locale property: The locale of the phrase. + * + * @return the locale value. + */ + @Generated + public String getLocale() { + return this.locale; + } + + /** + * Get the confidence property: The confidence value for the phrase. + * + * @return the confidence value. + */ + @Generated + public double getConfidence() { + return this.confidence; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("offsetMilliseconds", this.offset); + jsonWriter.writeIntField("durationMilliseconds", this.duration); + jsonWriter.writeStringField("text", this.text); + jsonWriter.writeDoubleField("confidence", this.confidence); + jsonWriter.writeNumberField("channel", this.channel); + jsonWriter.writeNumberField("speaker", this.speaker); + jsonWriter.writeArrayField("words", this.words, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("locale", this.locale); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TranscribedPhrase from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TranscribedPhrase 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 TranscribedPhrase. + */ + @Generated + public static TranscribedPhrase fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int offset = 0; + int duration = 0; + String text = null; + double confidence = 0.0; + Integer channel = null; + Integer speaker = null; + List words = null; + String locale = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("offsetMilliseconds".equals(fieldName)) { + offset = reader.getInt(); + } else if ("durationMilliseconds".equals(fieldName)) { + duration = reader.getInt(); + } else if ("text".equals(fieldName)) { + text = reader.getString(); + } else if ("confidence".equals(fieldName)) { + confidence = reader.getDouble(); + } else if ("channel".equals(fieldName)) { + channel = reader.getNullable(JsonReader::getInt); + } else if ("speaker".equals(fieldName)) { + speaker = reader.getNullable(JsonReader::getInt); + } else if ("words".equals(fieldName)) { + words = reader.readArray(reader1 -> TranscribedWord.fromJson(reader1)); + } else if ("locale".equals(fieldName)) { + locale = reader.getString(); + } else { + reader.skipChildren(); + } + } + TranscribedPhrase deserializedTranscribedPhrase = new TranscribedPhrase(offset, duration, text, confidence); + deserializedTranscribedPhrase.channel = channel; + deserializedTranscribedPhrase.speaker = speaker; + deserializedTranscribedPhrase.words = words; + deserializedTranscribedPhrase.locale = locale; + return deserializedTranscribedPhrase; + }); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscribedWord.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscribedWord.java new file mode 100644 index 000000000000..a0c046e15cbe --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscribedWord.java @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription.models; + +import com.azure.core.annotation.Generated; +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; +import java.time.Duration; + +/** + * Time-stamped word in the display form. + */ +@Immutable +public final class TranscribedWord implements JsonSerializable { + + /* + * The recognized word, including punctuation. + */ + @Generated + private final String text; + + /* + * The start offset of the word in milliseconds. + */ + @Generated + private final int offset; + + /* + * The duration of the word in milliseconds. + */ + @Generated + private final int duration; + + /** + * Creates an instance of TranscribedWord class. + * + * @param text the text value to set. + * @param offset the offset value to set. + * @param duration the duration value to set. + */ + @Generated + private TranscribedWord(String text, int offset, int duration) { + this.text = text; + this.offset = offset; + this.duration = duration; + } + + /** + * Get the text property: The recognized word, including punctuation. + * + * @return the text value. + */ + @Generated + public String getText() { + return this.text; + } + + /** + * Get the offset property: The start offset of the word in milliseconds. + * + * @return the offset value. + */ + @Generated + public int getOffset() { + return this.offset; + } + + /** + * Get the duration property: The duration in milliseconds. + * + * @return the duration value as Duration. + */ + @Generated + public Duration getDuration() { + return Duration.ofMillis(this.duration); + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("text", this.text); + jsonWriter.writeIntField("offsetMilliseconds", this.offset); + jsonWriter.writeIntField("durationMilliseconds", this.duration); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TranscribedWord from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TranscribedWord 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 TranscribedWord. + */ + @Generated + public static TranscribedWord fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String text = null; + int offset = 0; + int duration = 0; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("text".equals(fieldName)) { + text = reader.getString(); + } else if ("offsetMilliseconds".equals(fieldName)) { + offset = reader.getInt(); + } else if ("durationMilliseconds".equals(fieldName)) { + duration = reader.getInt(); + } else { + reader.skipChildren(); + } + } + return new TranscribedWord(text, offset, duration); + }); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionContent.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionContent.java new file mode 100644 index 000000000000..5ba64e48e89e --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionContent.java @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; + +/** + * Request model for transcription operation. + */ +@Fluent +public final class TranscriptionContent { + + /* + * The content of the audio file to be transcribed. The audio file must be shorter than 2 hours in audio duration + * and smaller than 250 MB in size. Optional if audioUrl is provided in the definition. + */ + @Generated + private AudioFileDetails audio; + + /** + * Get the audio property: The content of the audio file to be transcribed. The audio file must be shorter than 2 + * hours in audio duration and smaller than 250 MB in size. Optional if audioUrl is provided in the definition. + * + * @return the audio value. + */ + @Generated + public AudioFileDetails getAudio() { + return this.audio; + } + + /** + * Set the audio property: The content of the audio file to be transcribed. The audio file must be shorter than 2 + * hours in audio duration and smaller than 250 MB in size. Optional if audioUrl is provided in the definition. + * + * @param audio the audio value to set. + * @return the TranscriptionContent object itself. + */ + @Generated + public TranscriptionContent setAudio(AudioFileDetails audio) { + this.audio = audio; + return this; + } + + /** + * Creates an instance of TranscriptionContent class. + * + * @param options the options value to set. + */ + @Generated + public TranscriptionContent(TranscriptionOptions options) { + this.options = options; + } + + /* + * Metadata for a transcription request. This field contains a JSON-serialized object of type + * `TranscriptionOptions`. + */ + @Generated + private final TranscriptionOptions options; + + /** + * Get the options property: Metadata for a transcription request. This field contains a JSON-serialized object of + * type `TranscriptionOptions`. + * + * @return the options value. + */ + @Generated + public TranscriptionOptions getOptions() { + return this.options; + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionDiarizationOptions.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionDiarizationOptions.java new file mode 100644 index 000000000000..831c546c31ed --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionDiarizationOptions.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.ai.speech.transcription.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +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 Speaker Diarization settings. Diarization settings must be specified to enable speaker diarization. + */ +@Fluent +public final class TranscriptionDiarizationOptions implements JsonSerializable { + + /* + * Enable speaker diarization. This is automatically set to true when maxSpeakers is specified. + */ + @Generated + private Boolean enabled; + + /* + * Gets or sets a hint for the maximum number of speakers for diarization. Must be greater than 1 and less than 36. + */ + @Generated + private Integer maxSpeakers; + + /** + * Creates an instance of TranscriptionDiarizationOptions class. + */ + @Generated + public TranscriptionDiarizationOptions() { + } + + /** + * Get the enabled property: Enable speaker diarization. This is automatically set to true when maxSpeakers is + * specified. + * + * @return the enabled value. + */ + @Generated + public Boolean isEnabled() { + return this.enabled; + } + + /** + * Get the maxSpeakers property: Gets or sets a hint for the maximum number of speakers for diarization. Must be + * greater than 1 and less than 36. + * + * @return the maxSpeakers value. + */ + @Generated + public Integer getMaxSpeakers() { + return this.maxSpeakers; + } + + /** + * Set the maxSpeakers property: Gets or sets a hint for the maximum number of speakers for diarization. Must be + * greater than 1 and less than 36. + * + * @param maxSpeakers the maxSpeakers value to set. + * @return the TranscriptionDiarizationOptions object itself. + */ + @Generated + public TranscriptionDiarizationOptions setMaxSpeakers(Integer maxSpeakers) { + this.maxSpeakers = maxSpeakers; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + if (this.maxSpeakers != null) { + jsonWriter.writeBooleanField("enabled", true); + jsonWriter.writeNumberField("maxSpeakers", this.maxSpeakers); + } + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TranscriptionDiarizationOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TranscriptionDiarizationOptions 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 TranscriptionDiarizationOptions. + */ + @Generated + public static TranscriptionDiarizationOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TranscriptionDiarizationOptions deserializedTranscriptionDiarizationOptions + = new TranscriptionDiarizationOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("enabled".equals(fieldName)) { + deserializedTranscriptionDiarizationOptions.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("maxSpeakers".equals(fieldName)) { + deserializedTranscriptionDiarizationOptions.maxSpeakers = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + return deserializedTranscriptionDiarizationOptions; + }); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionOptions.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionOptions.java new file mode 100644 index 000000000000..2b298d84d59a --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionOptions.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +package com.azure.ai.speech.transcription.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Generated; +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; +import java.util.Map; + +/** + * Metadata for a transcription request. + */ +@Fluent +public final class TranscriptionOptions implements JsonSerializable { + + /* + * The URL of the audio to be transcribed. The audio must be shorter than 2 hours in audio duration and smaller than + * 250 MB in size. If both Audio and AudioUrl are provided, Audio is used. + */ + @Generated + private String audioUrl; + + /* + * A list of possible locales for the transcription. If not specified, the locale of the speech in the audio is + * detected automatically from all supported locales. + */ + @Generated + private List locales; + + /* + * Maps some or all candidate locales to a model URI to be used for transcription. If no mapping is given, the + * default model for the locale is used. + */ + @Generated + private Map localeModelMapping; + + /* + * Mode of profanity filtering. + */ + @Generated + private ProfanityFilterMode profanityFilterMode; + + /* + * Mode of diarization. + */ + @Generated + private TranscriptionDiarizationOptions diarizationOptions; + + /* + * The 0-based indices of the channels to be transcribed separately. If not specified, multiple channels are merged + * and transcribed jointly. Only up to two channels are supported. + */ + @Generated + private List activeChannels; + + /* + * Enhanced mode properties. + */ + @Generated + private EnhancedModeOptions enhancedModeOptions; + + /* + * Phrase list properties. + */ + @Generated + private PhraseListOptions phraseListOptions; + + /** + * Get the audioUrl property: The URL of the audio to be transcribed. The audio must be shorter than 2 hours in + * audio duration and smaller than 250 MB in size. If both Audio and AudioUrl are provided, Audio is used. + * + * @return the audioUrl value. + */ + @Generated + public String getAudioUrl() { + return this.audioUrl; + } + + /** + * Set the audioUrl property: The URL of the audio to be transcribed. The audio must be shorter than 2 hours in + * audio duration and smaller than 250 MB in size. If both Audio and AudioUrl are provided, Audio is used. + * + * @param audioUrl the audioUrl value to set. + * @return the TranscriptionOptions object itself. + */ + @Generated + private TranscriptionOptions setAudioUrl(String audioUrl) { + this.audioUrl = audioUrl; + return this; + } + + /** + * Get the locales property: A list of possible locales for the transcription. If not specified, the locale of the + * speech in the audio is detected automatically from all supported locales. + * + * @return the locales value. + */ + @Generated + public List getLocales() { + return this.locales; + } + + /** + * Set the locales property: A list of possible locales for the transcription. If not specified, the locale of the + * speech in the audio is detected automatically from all supported locales. + * + * @param locales the locales value to set. + * @return the TranscriptionOptions object itself. + */ + @Generated + public TranscriptionOptions setLocales(List locales) { + this.locales = locales; + return this; + } + + /** + * Get the localeModelMapping property: Maps some or all candidate locales to a model URI to be used for + * transcription. If no mapping is given, the default model for the locale is used. + * + * @return the localeModelMapping value. + */ + @Generated + public Map getLocaleModelMapping() { + return this.localeModelMapping; + } + + /** + * Set the localeModelMapping property: Maps some or all candidate locales to a model URI to be used for + * transcription. If no mapping is given, the default model for the locale is used. + * + * @param localeModelMapping the localeModelMapping value to set. + * @return the TranscriptionOptions object itself. + */ + @Generated + public TranscriptionOptions setLocaleModelMapping(Map localeModelMapping) { + this.localeModelMapping = localeModelMapping; + return this; + } + + /** + * Get the profanityFilterMode property: Mode of profanity filtering. + * + * @return the profanityFilterMode value. + */ + @Generated + public ProfanityFilterMode getProfanityFilterMode() { + return this.profanityFilterMode; + } + + /** + * Set the profanityFilterMode property: Mode of profanity filtering. + * + * @param profanityFilterMode the profanityFilterMode value to set. + * @return the TranscriptionOptions object itself. + */ + @Generated + public TranscriptionOptions setProfanityFilterMode(ProfanityFilterMode profanityFilterMode) { + this.profanityFilterMode = profanityFilterMode; + return this; + } + + /** + * Get the diarizationOptions property: Mode of diarization. + * + * @return the diarizationOptions value. + */ + @Generated + public TranscriptionDiarizationOptions getDiarizationOptions() { + return this.diarizationOptions; + } + + /** + * Set the diarizationOptions property: Mode of diarization. + * + * @param diarizationOptions the diarizationOptions value to set. + * @return the TranscriptionOptions object itself. + */ + @Generated + public TranscriptionOptions setDiarizationOptions(TranscriptionDiarizationOptions diarizationOptions) { + this.diarizationOptions = diarizationOptions; + return this; + } + + /** + * Get the activeChannels property: The 0-based indices of the channels to be transcribed separately. If not + * specified, multiple channels are merged and transcribed jointly. Only up to two channels are supported. + * + * @return the activeChannels value. + */ + @Generated + public List getActiveChannels() { + return this.activeChannels; + } + + /** + * Set the activeChannels property: The 0-based indices of the channels to be transcribed separately. If not + * specified, multiple channels are merged and transcribed jointly. Only up to two channels are supported. + * + * @param activeChannels the activeChannels value to set. + * @return the TranscriptionOptions object itself. + */ + @Generated + public TranscriptionOptions setActiveChannels(List activeChannels) { + this.activeChannels = activeChannels; + return this; + } + + /** + * Get the enhancedModeOptions property: Enhanced mode properties. + * + * @return the enhancedModeOptions value. + */ + @Generated + public EnhancedModeOptions getEnhancedModeOptions() { + return this.enhancedModeOptions; + } + + /** + * Set the enhancedModeOptions property: Enhanced mode properties. + * + * @param enhancedModeOptions the enhancedModeOptions value to set. + * @return the TranscriptionOptions object itself. + */ + @Generated + public TranscriptionOptions setEnhancedModeOptions(EnhancedModeOptions enhancedModeOptions) { + this.enhancedModeOptions = enhancedModeOptions; + return this; + } + + /** + * Get the phraseListOptions property: Phrase list properties. + * + * @return the phraseListOptions value. + */ + @Generated + public PhraseListOptions getPhraseListOptions() { + return this.phraseListOptions; + } + + /** + * Set the phraseListOptions property: Phrase list properties. + * + * @param phraseListOptions the phraseListOptions value to set. + * @return the TranscriptionOptions object itself. + */ + @Generated + public TranscriptionOptions setPhraseListOptions(PhraseListOptions phraseListOptions) { + this.phraseListOptions = phraseListOptions; + return this; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("audioUrl", this.audioUrl); + jsonWriter.writeArrayField("locales", this.locales, (writer, element) -> writer.writeString(element)); + jsonWriter.writeMapField("models", this.localeModelMapping, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("profanityFilterMode", + this.profanityFilterMode == null ? null : this.profanityFilterMode.toString()); + jsonWriter.writeJsonField("diarization", this.diarizationOptions); + jsonWriter.writeArrayField("channels", this.activeChannels, (writer, element) -> writer.writeInt(element)); + jsonWriter.writeJsonField("enhancedMode", this.enhancedModeOptions); + jsonWriter.writeJsonField("phraseList", this.phraseListOptions); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TranscriptionOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TranscriptionOptions 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 TranscriptionOptions. + */ + @Generated + public static TranscriptionOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TranscriptionOptions deserializedTranscriptionOptions = new TranscriptionOptions((String) null); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("audioUrl".equals(fieldName)) { + deserializedTranscriptionOptions.audioUrl = reader.getString(); + } else if ("locales".equals(fieldName)) { + List locales = reader.readArray(reader1 -> reader1.getString()); + deserializedTranscriptionOptions.locales = locales; + } else if ("localeModelMapping".equals(fieldName)) { + Map localeModelMapping = reader.readMap(reader1 -> reader1.getString()); + deserializedTranscriptionOptions.localeModelMapping = localeModelMapping; + } else if ("profanityFilterMode".equals(fieldName)) { + deserializedTranscriptionOptions.profanityFilterMode + = ProfanityFilterMode.fromString(reader.getString()); + } else if ("diarization".equals(fieldName)) { + deserializedTranscriptionOptions.diarizationOptions + = TranscriptionDiarizationOptions.fromJson(reader); + } else if ("channels".equals(fieldName)) { + List activeChannels = reader.readArray(reader1 -> reader1.getInt()); + deserializedTranscriptionOptions.activeChannels = activeChannels; + } else if ("enhancedMode".equals(fieldName)) { + deserializedTranscriptionOptions.enhancedModeOptions = EnhancedModeOptions.fromJson(reader); + } else if ("phraseList".equals(fieldName)) { + deserializedTranscriptionOptions.phraseListOptions = PhraseListOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + return deserializedTranscriptionOptions; + }); + } + + private final AudioFileDetails audioFileDetails; + + /** + * Creates an instance of TranscriptionOptions class with audio URL. + * + * @param audioUrl the URL of the audio to be transcribed + */ + public TranscriptionOptions(String audioUrl) { + this.audioUrl = audioUrl; + this.audioFileDetails = null; + } + + /** + * Creates an instance of TranscriptionOptions class with audio file details. + * + * @param fileDetails the audio file details + */ + public TranscriptionOptions(AudioFileDetails fileDetails) { + this.audioFileDetails = fileDetails; + } + + /** + * Get the audioFileDetails property: The audio file details for transcription. + * + * @return the audioFileDetails value. + */ + public AudioFileDetails getFileDetails() { + return this.audioFileDetails; + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionResult.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionResult.java new file mode 100644 index 000000000000..12d5a00d20a1 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/TranscriptionResult.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.ai.speech.transcription.models; + +import com.azure.core.annotation.Generated; +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; +import java.time.Duration; +import java.util.List; + +/** + * The result of the transcribe operation. + */ +@Immutable +public final class TranscriptionResult implements JsonSerializable { + + /* + * The duration of the audio in milliseconds. + */ + @Generated + private final int duration; + + /* + * The full transcript for each channel. + */ + @Generated + private final List combinedPhrases; + + /* + * The transcription results segmented into phrases. + */ + @Generated + private final List phrases; + + /** + * Creates an instance of TranscriptionResult class. + * + * @param duration the duration value to set. + * @param combinedPhrases the combinedPhrases value to set. + * @param phrases the phrases value to set. + */ + @Generated + private TranscriptionResult(int duration, List combinedPhrases, + List phrases) { + this.duration = duration; + this.combinedPhrases = combinedPhrases; + this.phrases = phrases; + } + + /** + * Get the duration property: The duration in milliseconds. + * + * @return the duration value as Duration. + */ + @Generated + public Duration getDuration() { + return Duration.ofMillis(this.duration); + } + + /** + * Get the combinedPhrases property: The full transcript for each channel. + * + * @return the combinedPhrases value. + */ + @Generated + public List getCombinedPhrases() { + return this.combinedPhrases; + } + + /** + * Get the phrases property: The transcription results segmented into phrases. + * + * @return the phrases value. + */ + @Generated + public List getPhrases() { + return this.phrases; + } + + /** + * {@inheritDoc} + */ + @Generated + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("durationMilliseconds", this.duration); + jsonWriter.writeArrayField("combinedPhrases", this.combinedPhrases, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("phrases", this.phrases, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TranscriptionResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TranscriptionResult 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 TranscriptionResult. + */ + @Generated + public static TranscriptionResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + int duration = 0; + List combinedPhrases = null; + List phrases = null; + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + if ("durationMilliseconds".equals(fieldName)) { + duration = reader.getInt(); + } else if ("combinedPhrases".equals(fieldName)) { + combinedPhrases = reader.readArray(reader1 -> ChannelCombinedPhrases.fromJson(reader1)); + } else if ("phrases".equals(fieldName)) { + phrases = reader.readArray(reader1 -> TranscribedPhrase.fromJson(reader1)); + } else { + reader.skipChildren(); + } + } + return new TranscriptionResult(duration, combinedPhrases, phrases); + }); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/package-info.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/package-info.java new file mode 100644 index 000000000000..f1ff4db6a641 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/models/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +/** + * + * Package containing the data models for Transcription. + * + */ +package com.azure.ai.speech.transcription.models; diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/package-info.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/package-info.java new file mode 100644 index 000000000000..8e50f3224f2d --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/com/azure/ai/speech/transcription/package-info.java @@ -0,0 +1,9 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. +/** + * + * Package containing the classes for Transcription. + * + */ +package com.azure.ai.speech.transcription; diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/java/module-info.java b/sdk/transcription/azure-ai-speech-transcription/src/main/java/module-info.java new file mode 100644 index 000000000000..434a8672d9f3 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/java/module-info.java @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +module com.azure.ai.speech.transcription { + requires transitive com.azure.core; + + exports com.azure.ai.speech.transcription; + exports com.azure.ai.speech.transcription.models; + + opens com.azure.ai.speech.transcription.models to com.azure.core; +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/resources/META-INF/azure-ai-speech-transcription_apiview_properties.json b/sdk/transcription/azure-ai-speech-transcription/src/main/resources/META-INF/azure-ai-speech-transcription_apiview_properties.json new file mode 100644 index 000000000000..e70a697123f8 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/resources/META-INF/azure-ai-speech-transcription_apiview_properties.json @@ -0,0 +1,23 @@ +{ + "flavor": "azure", + "CrossLanguageDefinitionId": { + "com.azure.ai.speech.transcription.TranscriptionAsyncClient": "Azure.Ai.Speech.Transcription", + "com.azure.ai.speech.transcription.TranscriptionAsyncClient.transcribe": "Azure.Ai.Speech.Transcription.transcribe", + "com.azure.ai.speech.transcription.TranscriptionAsyncClient.transcribeWithResponse": "Azure.Ai.Speech.Transcription.transcribe", + "com.azure.ai.speech.transcription.TranscriptionClient": "Azure.Ai.Speech.Transcription", + "com.azure.ai.speech.transcription.TranscriptionClient.transcribe": "Azure.Ai.Speech.Transcription.transcribe", + "com.azure.ai.speech.transcription.TranscriptionClient.transcribeWithResponse": "Azure.Ai.Speech.Transcription.transcribe", + "com.azure.ai.speech.transcription.TranscriptionClientBuilder": "Azure.Ai.Speech.Transcription", + "com.azure.ai.speech.transcription.models.AudioFileDetails": null, + "com.azure.ai.speech.transcription.models.ChannelCombinedPhrases": "Azure.Ai.Speech.Transcription.ChannelCombinedPhrases", + "com.azure.ai.speech.transcription.models.EnhancedModeOptions": "Azure.Ai.Speech.Transcription.EnhancedModeProperties", + "com.azure.ai.speech.transcription.models.PhraseListOptions": "Azure.Ai.Speech.Transcription.PhraseListProperties", + "com.azure.ai.speech.transcription.models.ProfanityFilterMode": "Azure.Ai.Speech.Transcription.ProfanityFilterMode", + "com.azure.ai.speech.transcription.models.TranscribedPhrase": "Azure.Ai.Speech.Transcription.TranscribedPhrase", + "com.azure.ai.speech.transcription.models.TranscribedWord": "Azure.Ai.Speech.Transcription.TranscribedWord", + "com.azure.ai.speech.transcription.models.TranscriptionContent": "Azure.Ai.Speech.Transcription.TranscriptionContent", + "com.azure.ai.speech.transcription.models.TranscriptionDiarizationOptions": "Azure.Ai.Speech.Transcription.TranscriptionDiarizationOptions", + "com.azure.ai.speech.transcription.models.TranscriptionOptions": "Azure.Ai.Speech.Transcription.TranscriptionOptions", + "com.azure.ai.speech.transcription.models.TranscriptionResult": "Azure.Ai.Speech.Transcription.TranscriptionResult" + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/resources/META-INF/azure-ai-speech-transcription_metadata.json b/sdk/transcription/azure-ai-speech-transcription/src/main/resources/META-INF/azure-ai-speech-transcription_metadata.json new file mode 100644 index 000000000000..7ff97cdfa258 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/resources/META-INF/azure-ai-speech-transcription_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersion":"2025-10-15","crossLanguageDefinitions":{"com.azure.ai.speech.transcription.TranscriptionAsyncClient":"Azure.Ai.Speech.Transcription","com.azure.ai.speech.transcription.TranscriptionAsyncClient.transcribe":"Azure.Ai.Speech.Transcription.transcribe","com.azure.ai.speech.transcription.TranscriptionAsyncClient.transcribeWithResponse":"Azure.Ai.Speech.Transcription.transcribe","com.azure.ai.speech.transcription.TranscriptionClient":"Azure.Ai.Speech.Transcription","com.azure.ai.speech.transcription.TranscriptionClient.transcribe":"Azure.Ai.Speech.Transcription.transcribe","com.azure.ai.speech.transcription.TranscriptionClient.transcribeWithResponse":"Azure.Ai.Speech.Transcription.transcribe","com.azure.ai.speech.transcription.TranscriptionClientBuilder":"Azure.Ai.Speech.Transcription","com.azure.ai.speech.transcription.models.AudioFileDetails":null,"com.azure.ai.speech.transcription.models.ChannelCombinedPhrases":"Azure.Ai.Speech.Transcription.ChannelCombinedPhrases","com.azure.ai.speech.transcription.models.EnhancedModeOptions":"Azure.Ai.Speech.Transcription.EnhancedModeProperties","com.azure.ai.speech.transcription.models.PhraseListOptions":"Azure.Ai.Speech.Transcription.PhraseListProperties","com.azure.ai.speech.transcription.models.ProfanityFilterMode":"Azure.Ai.Speech.Transcription.ProfanityFilterMode","com.azure.ai.speech.transcription.models.TranscribedPhrase":"Azure.Ai.Speech.Transcription.TranscribedPhrase","com.azure.ai.speech.transcription.models.TranscribedWord":"Azure.Ai.Speech.Transcription.TranscribedWord","com.azure.ai.speech.transcription.models.TranscriptionContent":"Azure.Ai.Speech.Transcription.TranscriptionContent","com.azure.ai.speech.transcription.models.TranscriptionDiarizationOptions":"Azure.Ai.Speech.Transcription.TranscriptionDiarizationOptions","com.azure.ai.speech.transcription.models.TranscriptionOptions":"Azure.Ai.Speech.Transcription.TranscriptionOptions","com.azure.ai.speech.transcription.models.TranscriptionResult":"Azure.Ai.Speech.Transcription.TranscriptionResult"},"generatedFiles":["src/main/java/com/azure/ai/speech/transcription/TranscriptionAsyncClient.java","src/main/java/com/azure/ai/speech/transcription/TranscriptionClient.java","src/main/java/com/azure/ai/speech/transcription/TranscriptionClientBuilder.java","src/main/java/com/azure/ai/speech/transcription/TranscriptionServiceVersion.java","src/main/java/com/azure/ai/speech/transcription/implementation/MultipartFormDataHelper.java","src/main/java/com/azure/ai/speech/transcription/implementation/TranscriptionClientImpl.java","src/main/java/com/azure/ai/speech/transcription/implementation/package-info.java","src/main/java/com/azure/ai/speech/transcription/models/AudioFileDetails.java","src/main/java/com/azure/ai/speech/transcription/models/ChannelCombinedPhrases.java","src/main/java/com/azure/ai/speech/transcription/models/EnhancedModeOptions.java","src/main/java/com/azure/ai/speech/transcription/models/PhraseListOptions.java","src/main/java/com/azure/ai/speech/transcription/models/ProfanityFilterMode.java","src/main/java/com/azure/ai/speech/transcription/models/TranscribedPhrase.java","src/main/java/com/azure/ai/speech/transcription/models/TranscribedWord.java","src/main/java/com/azure/ai/speech/transcription/models/TranscriptionContent.java","src/main/java/com/azure/ai/speech/transcription/models/TranscriptionDiarizationOptions.java","src/main/java/com/azure/ai/speech/transcription/models/TranscriptionOptions.java","src/main/java/com/azure/ai/speech/transcription/models/TranscriptionResult.java","src/main/java/com/azure/ai/speech/transcription/models/package-info.java","src/main/java/com/azure/ai/speech/transcription/package-info.java","src/main/java/module-info.java"]} \ No newline at end of file diff --git a/sdk/transcription/azure-ai-speech-transcription/src/main/resources/azure-ai-speech-transcription.properties b/sdk/transcription/azure-ai-speech-transcription/src/main/resources/azure-ai-speech-transcription.properties new file mode 100644 index 000000000000..ca812989b4f2 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/main/resources/azure-ai-speech-transcription.properties @@ -0,0 +1,2 @@ +name=${project.artifactId} +version=${project.version} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/assets/sample-audio.wav b/sdk/transcription/azure-ai-speech-transcription/src/samples/assets/sample-audio.wav new file mode 100644 index 000000000000..bf23d54b0c00 Binary files /dev/null and b/sdk/transcription/azure-ai-speech-transcription/src/samples/assets/sample-audio.wav differ diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/assets/sample-profanity.wav b/sdk/transcription/azure-ai-speech-transcription/src/samples/assets/sample-profanity.wav new file mode 100644 index 000000000000..e1926b3f5dcf Binary files /dev/null and b/sdk/transcription/azure-ai-speech-transcription/src/samples/assets/sample-profanity.wav differ diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/EnhancedModeSample.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/EnhancedModeSample.java new file mode 100644 index 000000000000..7abd8b0fc543 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/EnhancedModeSample.java @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +// BEGIN: com.azure.ai.speech.transcription.enhancedmode.imports +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.EnhancedModeOptions; +import com.azure.ai.speech.transcription.models.ProfanityFilterMode; +import com.azure.ai.speech.transcription.models.TranscriptionDiarizationOptions; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.KeyCredential; +import com.azure.core.util.BinaryData; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; +// END: com.azure.ai.speech.transcription.enhancedmode.imports + +/** + * Sample demonstrates how to use EnhancedModeOptions with LLM-enhanced speech transcription + * combining multiple features for optimal transcription quality. + * + * This sample shows: + * - Using lexical format prompts to guide LLM output + * - Providing domain-specific context for technical terminology + * - Enabling diarization (speaker identification) with enhanced mode + * - Configuring profanity filtering + * + * Enhanced mode leverages large language models to improve transcription quality + * by understanding context and domain-specific terminology. + */ +public class EnhancedModeSample { + /** + * Main method to run the enhanced mode sample. + * + * @param args command line arguments (not used) + */ + public static void main(String[] args) { + String endpoint = System.getenv("SPEECH_ENDPOINT"); + String apiKey = System.getenv("SPEECH_API_KEY"); + + if (endpoint == null || apiKey == null) { + System.err.println("Please set SPEECH_ENDPOINT and SPEECH_API_KEY environment variables"); + System.err.println("Example:"); + System.err.println(" set SPEECH_ENDPOINT=https://your-resource-name.cognitiveservices.azure.com/"); + System.err.println(" set SPEECH_API_KEY=your-api-key"); + return; + } + + System.out.println("Azure AI Speech Transcription - Enhanced Mode Sample"); + System.out.println("=====================================================\n"); + + // Demonstrate full enhanced mode with all features combined + demonstrateFullEnhancedMode(endpoint, apiKey); + } + + /** + * Demonstrates using full enhanced mode with multiple features combined. + * This shows how to use lexical format prompts, domain context, diarization, + * and profanity filtering together for optimal transcription quality. + */ + private static void demonstrateFullEnhancedMode(String endpoint, String apiKey) { + System.out.println("Enhanced Mode with Multiple Features Combined"); + System.out.println("----------------------------------------------"); + + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(apiKey)) + .buildClient(); + + try { + String audioFilePath = "src/samples/assets/sample-audio.wav"; + if (!Files.exists(Paths.get(audioFilePath))) { + System.out.println("Audio file not found: " + audioFilePath); + System.out.println(" Skipping this example.\n"); + return; + } + + byte[] audioData = Files.readAllBytes(Paths.get(audioFilePath)); + + // Use the helper method to demonstrate full configuration + TranscriptionResult result = transcribeWithFullEnhancedMode(client, audioData, audioFilePath); + + System.out.println(" Full enhanced mode configuration applied"); + System.out.println("Features: LLM prompts, diarization, profanity filtering"); + System.out.println("Duration: " + result.getDuration() + " ms"); + if (result.getCombinedPhrases() != null && !result.getCombinedPhrases().isEmpty()) { + System.out.println("\nTranscription: " + result.getCombinedPhrases().get(0).getText()); + } + if (result.getPhrases() != null && !result.getPhrases().isEmpty()) { + System.out.println("\nPhrases with speakers:"); + result.getPhrases().forEach(phrase -> + System.out.println(" [Speaker " + phrase.getSpeaker() + ", " + + phrase.getOffset() + " ms] " + phrase.getText()) + ); + } + System.out.println(); + + } catch (IOException e) { + System.err.println("Error reading audio file: " + e.getMessage() + "\n"); + } catch (Exception e) { + System.err.println("Error during transcription: " + e.getMessage() + "\n"); + } + } + + /** + * Helper method demonstrating how to combine all enhanced mode features. + * This is a reusable pattern for high-quality LLM-enhanced transcription. + */ + // BEGIN: com.azure.ai.speech.transcription.enhancedmode.complete + private static TranscriptionResult transcribeWithFullEnhancedMode( + TranscriptionClient client, + byte[] audioData, + String filename + ) throws Exception { + // Create audio file details + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Configure comprehensive LLM-enhanced mode settings + // Enhanced mode is automatically enabled when you create EnhancedModeOptions + // Always include lexical format prompt for best results + EnhancedModeOptions enhancedMode = new EnhancedModeOptions() + .setTask("transcribe") + .setPrompts(Arrays.asList( + "Output must be in lexical format." + )); + + // Enable diarization for speaker identification + TranscriptionDiarizationOptions diarizationOptions = new TranscriptionDiarizationOptions() + .setMaxSpeakers(5); + + // Create transcription options with all features enabled + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setLocales(Arrays.asList()) + .setEnhancedModeOptions(enhancedMode) + .setDiarizationOptions(diarizationOptions) + .setProfanityFilterMode(ProfanityFilterMode.MASKED); + + // Transcribe with full LLM-enhanced mode and diarization + return client.transcribe(options); + } + // END: com.azure.ai.speech.transcription.enhancedmode.complete +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/README.md b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/README.md new file mode 100644 index 000000000000..65eb1d9979d5 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/README.md @@ -0,0 +1,260 @@ +# Azure AI Speech Transcription Samples + +This directory contains runnable code samples that demonstrate how to use the Azure AI Speech Transcription client library for Java. + +## Prerequisites + +To run these samples, you need: + +1. **Azure Subscription**: An active Azure subscription +2. **Azure AI Speech Service Resource**: Create one in the [Azure Portal](https://portal.azure.com) +3. **Authentication**: Choose one of the following authentication methods: + +### Option 1: Entra ID Authentication (Recommended for Production) + + Set the endpoint and configure Entra ID credentials: + + ```bash + set SPEECH_ENDPOINT=https://your-resource-name.cognitiveservices.azure.com/ + ``` + + **And** configure one of the following credential sources: + - **Managed Identity**: For apps running in Azure (App Service, Azure Functions, VMs, etc.) + - **Azure CLI**: Run `az login` on your development machine + - **Environment Variables**: Set `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, and `AZURE_CLIENT_SECRET` + - **Visual Studio Code or IntelliJ**: Sign in through your IDE + + **Note**: You'll also need to assign the "Cognitive Services User" role to your identity: + + ```bash + az role assignment create --assignee \ + --role "Cognitive Services User" \ + --scope /subscriptions//resourceGroups//providers/Microsoft.CognitiveServices/accounts/ + ``` + + **Required dependency** for Entra ID authentication: + + ```xml + + com.azure + azure-identity + 1.13.0 + + ``` + + ### Option 2: API Key Authentication (Easier for Getting Started) + + Set these environment variables: + + ```bash + set SPEECH_ENDPOINT=https://your-resource-name.cognitiveservices.azure.com/ + ``` + + **And** configure one of the following credential sources: + - **Managed Identity**: For apps running in Azure (App Service, Azure Functions, VMs, etc.) + - **Azure CLI**: Run `az login` on your development machine + - **Environment Variables**: Set `AZURE_TENANT_ID`, `AZURE_CLIENT_ID`, and `AZURE_CLIENT_SECRET` + - **Visual Studio Code or IntelliJ**: Sign in through your IDE + + **Note**: You'll also need to assign the "Cognitive Services User" role to your identity: + + ```bash + az role assignment create --assignee \ + --role "Cognitive Services User" \ + --scope /subscriptions//resourceGroups//providers/Microsoft.CognitiveServices/accounts/ + ``` + + **Required dependency** for Entra ID authentication: + + ```xml + + com.azure + azure-identity + 1.13.0 + + ``` + +4. **Audio File**: Some samples require an audio file named `sample-audio.wav` in the working directory + +## Authentication Methods + +All samples in this directory support **both authentication methods**: + +- **Entra ID (TokenCredential)**: Uses `DefaultAzureCredential` from azure-identity +- **API Key (KeyCredential)**: Uses the `SPEECH_API_KEY` environment variable + +The samples will automatically detect which authentication method to use based on the environment variables you've set. If `SPEECH_API_KEY` is set, it will use API Key authentication; otherwise, it will attempt Entra ID authentication. + +## Available Samples + +### TranscribeAudioFileSample.java + +**Champion scenario**: Basic audio transcription from a file + +Demonstrates the most common use case - transcribing a single audio file with minimal configuration. + +**Key features**: + +- Creating a TranscriptionClient +- Reading an audio file +- Transcribing with default options +- Processing results + +**Run**: + +```bash +cd sdk/transcription/azure-ai-speech-transcription +mvn exec:java -Dexec.mainClass="com.azure.ai.speech.transcription.TranscribeAudioFileSample" +``` + +--- + +### TranscribeFromUrlSample.java + +**Champion scenario**: Transcribe audio from a URL + +Demonstrates how to transcribe audio directly from a URL without downloading the file locally. + +**Key features**: + +- Creating TranscriptionOptions with a URL +- Transcribing remote audio files + +**Run**: + +```bash +mvn exec:java -Dexec.mainClass="com.azure.ai.speech.transcription.TranscribeFromUrlSample" +``` + +--- + +### TranscribeMultiLanguageSample.java + +**Champion scenario**: Multi-language transcription + +Demonstrates how to transcribe audio containing multiple languages with automatic language detection. + +**Key features**: + +- Automatic language detection +- Handling multi-language results + +**Run**: + +```bash +mvn exec:java -Dexec.mainClass="com.azure.ai.speech.transcription.TranscribeMultiLanguageSample" +``` + +--- + +### EnhancedModeSample.java + +**Champion scenario**: Enhanced transcription quality + +Demonstrates how to use enhanced mode with custom prompts and other advanced features. + +**Key features**: + +- Using EnhancedModeOptions +- Providing custom prompts for better accuracy +- Specifying task types + +**Run**: + +```bash +mvn exec:java -Dexec.mainClass="com.azure.ai.speech.transcription.EnhancedModeSample" +``` + +--- + +### TranscribeWithDiarizationSample.java + +**Champion scenario**: Speaker diarization + +Demonstrates how to identify different speakers in the audio. + +**Key features**: + +- Enabling speaker diarization +- Configuring max speakers +- Processing speaker-separated results + +**Run**: + +```bash +mvn exec:java -Dexec.mainClass="com.azure.ai.speech.transcription.TranscribeWithDiarizationSample" +``` + +--- + +### TranscribeWithPhraseListSample.java + +**Champion scenario**: Improving accuracy with phrase lists + +Demonstrates how to use a phrase list to improve recognition of specific terms. + +**Key features**: + +- Creating a PhraseListOptions +- Adding custom phrases and boosting their probability +- Improving accuracy for domain-specific terminology + +**Run**: + +```bash +mvn exec:java -Dexec.mainClass="com.azure.ai.speech.transcription.TranscribeWithPhraseListSample" +``` + +--- + +### TranscribeWithProfanityFilterSample.java + +**Champion scenario**: Profanity filtering + +Demonstrates how to configure profanity filtering options. + +**Key features**: + +- Setting ProfanityFilterMode (Masked, Removed, None) +- Handling filtered results + +**Run**: + +```bash +mvn exec:java -Dexec.mainClass="com.azure.ai.speech.transcription.TranscribeWithProfanityFilterSample" +``` + +--- + +### ReadmeSamples.java + +Code snippets used in the main README.md and API documentation (JavaDoc). + +**Note**: This file is used by the `codesnippet-maven-plugin` to inject code into documentation. It's not meant to be run directly. + +## Supported Audio Formats + +The service supports various audio formats: + +- **WAV** (recommended: 16 kHz, 16-bit, mono PCM) +- **MP3** +- **OGG** +- **FLAC** +- And more + +**Constraints**: + +- Maximum file size: 250 MB +- Maximum duration: 2 hours + +## Getting Help + +- [Azure AI Speech Documentation](https://learn.microsoft.com/azure/ai-services/speech-service/) +- [SDK README](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/transcription/azure-ai-speech-transcription) +- [GitHub Issues](https://github.com/Azure/azure-sdk-for-java/issues) + +## Additional Resources + +- [Azure SDK for Java Guidelines](https://azure.github.io/azure-sdk/java_introduction.html) +- [Project Reactor Documentation](https://projectreactor.io/docs) +- [Azure SDK Blog](https://devblogs.microsoft.com/azure-sdk/) diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/ReadmeSamples.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/ReadmeSamples.java new file mode 100644 index 000000000000..6dfd93d716c4 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/ReadmeSamples.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.ai.speech.transcription; + +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.EnhancedModeOptions; +import com.azure.ai.speech.transcription.models.PhraseListOptions; +import com.azure.ai.speech.transcription.models.ProfanityFilterMode; +import com.azure.ai.speech.transcription.models.TranscriptionDiarizationOptions; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.KeyCredential; +import com.azure.core.http.policy.ExponentialBackoffOptions; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.policy.RetryOptions; +import com.azure.core.util.BinaryData; + +import java.nio.file.Files; +import java.nio.file.Paths; + +public final class ReadmeSamples { + /** + * Sample for basic audio transcription. + */ + public void readmeSamples() { + // BEGIN: com.azure.ai.speech.transcription.readme + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + try { + // Read audio file + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + // Create audio file details + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Create transcription options + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + // Transcribe audio + TranscriptionResult result = client.transcribe(options); + + // Process results + System.out.println("Duration: " + result.getDuration() + " ms"); + result.getCombinedPhrases().forEach(phrase -> { + System.out.println("Channel " + phrase.getChannel() + ": " + phrase.getText()); + }); + } catch (Exception e) { + System.err.println("Error during transcription: " + e.getMessage()); + } + // END: com.azure.ai.speech.transcription.readme + } + + /** + * Sample for creating a synchronous TranscriptionClient. + */ + public void createSyncClient() { + // BEGIN: com.azure.ai.speech.transcription.transcriptionclient.instantiation + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + // END: com.azure.ai.speech.transcription.transcriptionclient.instantiation + } + + /** + * Sample for creating an asynchronous TranscriptionAsyncClient. + */ + public void createAsyncClient() { + // BEGIN: com.azure.ai.speech.transcription.transcriptionasyncclient.instantiation + TranscriptionAsyncClient asyncClient = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildAsyncClient(); + // END: com.azure.ai.speech.transcription.transcriptionasyncclient.instantiation + } + + /** + * Sample for transcribing audio with the synchronous client. + */ + public void transcribeAudioSync() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionclient.transcribe + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + TranscriptionResult result = client.transcribe(options); + + System.out.println("Duration: " + result.getDuration() + " ms"); + result.getCombinedPhrases().forEach(phrase -> { + System.out.println("Transcription: " + phrase.getText()); + }); + // END: com.azure.ai.speech.transcription.transcriptionclient.transcribe + } + + /** + * Sample for transcribing audio with the asynchronous client. + */ + public void transcribeAudioAsync() throws Exception { + TranscriptionAsyncClient asyncClient = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildAsyncClient(); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + asyncClient.transcribe(options) + .subscribe(result -> { + System.out.println("Duration: " + result.getDuration() + " ms"); + result.getCombinedPhrases().forEach(phrase -> { + System.out.println("Transcription: " + phrase.getText()); + }); + }); + // END: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe + } + + /** + * Sample for configuring advanced transcription options. + */ + public void advancedTranscriptionOptions() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionoptions.advanced + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Configure advanced options + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setLocales(java.util.Arrays.asList("en-US", "es-ES")) // Specify candidate locales + .setProfanityFilterMode(ProfanityFilterMode.MASKED) // Mask profanity + .setDiarizationOptions(new TranscriptionDiarizationOptions() // Enable speaker diarization + .setMaxSpeakers(5)); + + TranscriptionResult result = client.transcribe(options); + + // Access detailed results + result.getPhrases().forEach(phrase -> { + System.out.println("Speaker " + phrase.getSpeaker() + ": " + phrase.getText()); + System.out.println("Confidence: " + phrase.getConfidence()); + System.out.println("Offset: " + phrase.getOffset() + " ms"); + }); + // END: com.azure.ai.speech.transcription.transcriptionoptions.advanced + } + + /** + * Sample for building client with custom configuration. + */ + public void clientWithCustomConfiguration() { + // BEGIN: com.azure.ai.speech.transcription.transcriptionclientbuilder.configuration + HttpLogOptions logOptions = new HttpLogOptions() + .setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS); + + RetryOptions retryOptions = new RetryOptions(new ExponentialBackoffOptions() + .setMaxRetries(5) + .setBaseDelay(java.time.Duration.ofSeconds(1)) + .setMaxDelay(java.time.Duration.ofSeconds(60))); + + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .httpLogOptions(logOptions) + .retryOptions(retryOptions) + .buildClient(); + // END: com.azure.ai.speech.transcription.transcriptionclientbuilder.configuration + } + + /** + * Sample for processing detailed transcription results. + */ + public void processDetailedResults() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionresult.detailed + TranscriptionResult result = client.transcribe(options); + + // Get overall duration + System.out.println("Total duration: " + result.getDuration() + " ms"); + + // Process each phrase with detailed information + result.getPhrases().forEach(phrase -> { + System.out.println("\nPhrase: " + phrase.getText()); + System.out.println(" Channel: " + phrase.getChannel()); + System.out.println(" Speaker: " + phrase.getSpeaker()); + System.out.println(" Locale: " + phrase.getLocale()); + System.out.println(" Confidence: " + phrase.getConfidence()); + System.out.println(" Timing: " + phrase.getOffset() + " ms - " + + (phrase.getOffset() + phrase.getDuration().toMillis()) + " ms"); + + // Process individual words with timestamps + if (phrase.getWords() != null) { + phrase.getWords().forEach(word -> { + System.out.println(" Word: " + word.getText() + " @ " + + word.getOffset() + " ms"); + }); + } + }); + // END: com.azure.ai.speech.transcription.transcriptionresult.detailed + } + + /** + * Sample for using enhanced mode to improve transcription quality. + */ + public void enhancedModeBasic() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + // BEGIN: readme-sample-enhancedModeBasic + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Enhanced mode is automatically enabled when you create EnhancedModeOptions + EnhancedModeOptions enhancedMode = new EnhancedModeOptions() + .setPrompts(java.util.Arrays.asList( + "Output must be in lexical format." + )); + + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setLocales(java.util.Arrays.asList("en-US", "es-ES")) + .setEnhancedModeOptions(enhancedMode); + + TranscriptionResult result = client.transcribe(options); + // END: readme-sample-enhancedModeBasic + } + + /** + * Sample for using enhanced mode with custom prompts. + */ + public void enhancedModeWithPrompts() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + // BEGIN: readme-sample-enhancedModeWithPrompts + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Enhanced mode is automatically enabled + // Use prompts to guide transcription with domain-specific terminology + // Always include lexical format prompt for best results + EnhancedModeOptions enhancedMode = new EnhancedModeOptions() + .setPrompts(java.util.Arrays.asList( + "Output must be in lexical format.", + "Medical consultation discussing hypertension and diabetes", + "Common medications: metformin, lisinopril, atorvastatin", + "Patient symptoms and treatment plan" + )); + + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setLocales(java.util.Arrays.asList("en-US", "es-ES")) + .setEnhancedModeOptions(enhancedMode); + + TranscriptionResult result = client.transcribe(options); + // END: readme-sample-enhancedModeWithPrompts + } + + /** + * Sample for using enhanced mode with translation. + */ + public void enhancedModeWithTranslation() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + // BEGIN: readme-sample-enhancedModeWithTranslation + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Enhanced mode is automatically enabled + // Configure enhanced mode to transcribe Spanish audio and translate to English + EnhancedModeOptions enhancedMode = new EnhancedModeOptions() + .setTargetLanguage("en-US"); // Translate to English + + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setLocales(java.util.Arrays.asList("es-ES")) // Source language: Spanish + .setEnhancedModeOptions(enhancedMode); + + TranscriptionResult result = client.transcribe(options); + // END: readme-sample-enhancedModeWithTranslation + } + + /** + * Sample for transcribing audio using audio URL constructor. + */ + public void transcribeWithAudioUrl() { + // BEGIN: readme-sample-transcribeWithAudioUrl + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + // Create transcription options with audio URL + TranscriptionOptions options = new TranscriptionOptions("https://example.com/audio.wav"); + + // Transcribe audio + TranscriptionResult result = client.transcribe(options); + + // Process results + result.getCombinedPhrases().forEach(phrase -> { + System.out.println(phrase.getText()); + }); + // END: readme-sample-transcribeWithAudioUrl + } + + /** + * Sample for multi-language transcription. + */ + public void transcribeMultiLanguage() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionoptions.multilanguage + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Configure transcription WITHOUT specifying locales + // This allows the service to auto-detect and transcribe multiple languages + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + TranscriptionResult result = client.transcribe(options); + + result.getPhrases().forEach(phrase -> { + System.out.println("Language: " + phrase.getLocale()); + System.out.println("Text: " + phrase.getText()); + }); + // END: com.azure.ai.speech.transcription.transcriptionoptions.multilanguage + } + + /** + * Sample for enhanced mode transcription. + */ + public void transcribeEnhancedMode() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionoptions.enhancedmode + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Enhanced mode is automatically enabled + EnhancedModeOptions enhancedMode = new EnhancedModeOptions() + .setTask("transcribe") + .setPrompts(java.util.Arrays.asList("Output must be in lexical format.")); + + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setEnhancedModeOptions(enhancedMode); + + TranscriptionResult result = client.transcribe(options); + + System.out.println("Transcription: " + result.getCombinedPhrases().get(0).getText()); + // END: com.azure.ai.speech.transcription.transcriptionoptions.enhancedmode + } + + /** + * Sample for transcription with phrase list. + */ + public void transcribeWithPhraseList() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint("https://.cognitiveservices.azure.com/") + .credential(new KeyCredential("")) + .buildClient(); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionoptions.phraselist + byte[] audioData = Files.readAllBytes(Paths.get("path/to/audio.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + PhraseListOptions phraseListOptions = new PhraseListOptions() + .setPhrases(java.util.Arrays.asList("Azure", "Cognitive Services")) + .setBiasingWeight(5.0); + + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setPhraseListOptions(phraseListOptions); + + TranscriptionResult result = client.transcribe(options); + + result.getCombinedPhrases().forEach(phrase -> { + System.out.println(phrase.getText()); + }); + // END: com.azure.ai.speech.transcription.transcriptionoptions.phraselist + } +} + diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeAudioFileSample.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeAudioFileSample.java new file mode 100644 index 000000000000..382d5c473bef --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeAudioFileSample.java @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.KeyCredential; +import com.azure.core.util.BinaryData; + +import java.nio.file.Files; +import java.nio.file.Paths; + +/** + * Simplest possible example of transcribing an audio file. + * + * This sample demonstrates the absolute minimum code needed to: + * 1. Create a client + * 2. Load an audio file + * 3. Transcribe it + * 4. Get the text result + */ +public class TranscribeAudioFileSample { + public static void main(String[] args) { + try { + // Get credentials from environment variables + String endpoint = System.getenv("SPEECH_ENDPOINT"); + String apiKey = System.getenv("SPEECH_API_KEY"); + + // Create client + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(apiKey)) + .buildClient(); + + // Load audio file + String audioFilePath = "src/samples/assets/sample-audio.wav"; + byte[] audioData = Files.readAllBytes(Paths.get(audioFilePath)); + + // Create audio file details + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Transcribe + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + TranscriptionResult result = client.transcribe(options); + + // Print result + System.out.println("Transcription:"); + result.getCombinedPhrases().forEach(phrase -> + System.out.println(phrase.getText()) + ); + + } catch (Exception e) { + System.err.println("Error: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeFromUrlSample.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeFromUrlSample.java new file mode 100644 index 000000000000..b1f77c0beba9 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeFromUrlSample.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.AzureKeyCredential; +import java.util.Arrays; + +/** + * Sample demonstrates how to transcribe audio from a URL. + */ +public class TranscribeFromUrlSample { + + /** + * Main method to invoke this demo. + * + * @param args Unused arguments to the program. + */ + public static void main(String[] args) { + String endpoint = System.getenv("SPEECH_ENDPOINT"); + String apiKey = System.getenv("SPEECH_API_KEY"); + + if (endpoint == null || apiKey == null) { + System.err.println("Please set SPEECH_ENDPOINT and SPEECH_API_KEY environment variables."); + System.exit(1); + } + + // Create the transcription client + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .buildClient(); + + System.out.println("Azure AI Speech Transcription - Transcribe from URL Sample"); + System.out.println("============================================================\n"); + + // Audio file URL (must be publicly accessible) + // Using sample audio from Azure documentation + String audioUrl = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-speech-sdk/master/sampledata/audiofiles/aboutSpeechSdk.wav"; + + System.out.println("Transcribing audio from URL: " + audioUrl); + System.out.println(); + + // Create transcription options with audio URL + TranscriptionOptions options = new TranscriptionOptions(audioUrl) + .setLocales(Arrays.asList("en-US")); + + // Transcribe the audio from URL + TranscriptionResult result = client.transcribe(options); + + // Display results + System.out.println("Transcription Results:"); + System.out.println("---------------------"); + System.out.println("Duration: " + result.getDuration() + "\n"); + + if (result.getCombinedPhrases() != null && !result.getCombinedPhrases().isEmpty()) { + System.out.println("Combined text: " + result.getCombinedPhrases().get(0).getText()); + } + + System.out.println(); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeMultiLanguageSample.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeMultiLanguageSample.java new file mode 100644 index 000000000000..fedc4499806e --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeMultiLanguageSample.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.TranscribedPhrase; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.AzureKeyCredential; +import com.azure.core.util.BinaryData; +import java.nio.file.Files; +import java.nio.file.Paths; + +/** + * Sample demonstrates how to transcribe audio containing multiple languages. + * + * When locales are NOT specified, the service automatically detects and transcribes + * multiple languages within the same audio file, switching between them as needed. + * This is useful for: + * - Multilingual conversations + * - Code-switched speech (e.g., Spanish-English) + * - International meetings or interviews + */ +public class TranscribeMultiLanguageSample { + + /** + * Main method to invoke this demo. + * + * @param args Unused arguments to the program. + */ + public static void main(String[] args) { + String endpoint = System.getenv("SPEECH_ENDPOINT"); + String apiKey = System.getenv("SPEECH_API_KEY"); + + if (endpoint == null || apiKey == null) { + System.err.println("Please set SPEECH_ENDPOINT and SPEECH_API_KEY environment variables."); + System.exit(1); + } + + System.out.println("Azure AI Speech Transcription - Multi-Language Sample"); + System.out.println("=====================================================\n"); + + // Create the transcription client + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new AzureKeyCredential(apiKey)) + .buildClient(); + + try { + // Load audio file + String audioFilePath = "src/samples/assets/sample-audio.wav"; + byte[] audioData = Files.readAllBytes(Paths.get(audioFilePath)); + AudioFileDetails fileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Configure transcription WITHOUT specifying locales + // This allows the service to auto-detect and transcribe multiple languages + // within the same audio file, switching between them as needed + TranscriptionOptions options = new TranscriptionOptions(fileDetails); + + System.out.println("Transcribing with automatic multi-language detection..."); + System.out.println("(No locale specified - service will detect all languages)\n"); + + // Transcribe the audio + TranscriptionResult result = client.transcribe(options); + + // Display results + System.out.println("Transcription Results:"); + System.out.println("---------------------"); + System.out.println("Duration: " + result.getDuration()); + System.out.println("Total phrases found: " + (result.getPhrases() != null ? result.getPhrases().size() : 0)); + System.out.println("Total combined phrases: " + (result.getCombinedPhrases() != null ? result.getCombinedPhrases().size() : 0)); + System.out.println(); + + // Show detailed phrases with timestamps + if (result.getPhrases() != null && !result.getPhrases().isEmpty()) { + System.out.println("Detailed Phrases:"); + System.out.println("-----------------"); + + for (int i = 0; i < result.getPhrases().size(); i++) { + TranscribedPhrase phrase = result.getPhrases().get(i); + long offsetMs = phrase.getOffset(); + long durationMs = phrase.getDuration().toMillis(); + + System.out.println("\n[Phrase " + (i + 1) + "] " + offsetMs + "ms - " + (offsetMs + durationMs) + "ms"); + System.out.println("Locale: " + phrase.getLocale()); + System.out.println("Text: " + phrase.getText()); + } + } + + // Also show combined phrases per channel + if (result.getCombinedPhrases() != null && !result.getCombinedPhrases().isEmpty()) { + System.out.println("\n\nCombined Transcription (All Languages):"); + System.out.println("========================================"); + result.getCombinedPhrases().forEach(phrase -> { + System.out.println(phrase.getText()); + }); + } + + System.out.println("\nNote: When no locales are specified, the service transcribes all languages"); + System.out.println("present in the audio. However, the locale field in each phrase may not always"); + System.out.println("accurately reflect the actual language of that specific phrase."); + } catch (Exception e) { + System.err.println("Error: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeWithDiarizationSample.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeWithDiarizationSample.java new file mode 100644 index 000000000000..bf57f4308f36 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeWithDiarizationSample.java @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.TranscribedPhrase; +import com.azure.ai.speech.transcription.models.TranscriptionDiarizationOptions; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.KeyCredential; +import com.azure.core.util.BinaryData; + +import java.nio.file.Files; +import java.nio.file.Paths; + +/** + * Sample demonstrates using speaker diarization to identify different speakers in audio. + * + * Speaker diarization detects and separates different speakers in the audio, labeling + * each transcribed segment with a speaker ID. This is useful for: + * - Meeting transcriptions + * - Interview recordings + * - Multi-person conversations + * - Podcast transcriptions + */ +public class TranscribeWithDiarizationSample { + public static void main(String[] args) { + String endpoint = System.getenv("SPEECH_ENDPOINT"); + String apiKey = System.getenv("SPEECH_API_KEY"); + + if (endpoint == null || apiKey == null) { + System.err.println("Please set SPEECH_ENDPOINT and SPEECH_API_KEY environment variables"); + return; + } + + System.out.println("Azure AI Speech Transcription - Speaker Diarization Sample"); + System.out.println("===========================================================\n"); + + // Create client + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(apiKey)) + .buildClient(); + + try { + // Load audio file + String audioFilePath = "src/samples/assets/sample-audio.wav"; + byte[] audioData = Files.readAllBytes(Paths.get(audioFilePath)); + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Configure speaker diarization + TranscriptionDiarizationOptions diarizationOptions = new TranscriptionDiarizationOptions() + .setMaxSpeakers(5); // Maximum number of speakers to detect (2-36) + + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setDiarizationOptions(diarizationOptions); + + System.out.println("Transcribing with speaker diarization (max 5 speakers)...\n"); + + // Transcribe with diarization + TranscriptionResult result = client.transcribe(options); + + // Display results organized by speaker + System.out.println("Transcription with Speaker Information:"); + System.out.println("----------------------------------------"); + + if (result.getPhrases() != null && !result.getPhrases().isEmpty()) { + for (TranscribedPhrase phrase : result.getPhrases()) { + int speakerId = phrase.getSpeaker() != null ? phrase.getSpeaker() : 0; + double startTime = phrase.getOffset() / 1000.0; + double endTime = (phrase.getOffset() + phrase.getDuration().toMillis()) / 1000.0; + + System.out.println(String.format("\n[Speaker %d] (%.2fs - %.2fs)", + speakerId, startTime, endTime)); + System.out.println(phrase.getText()); + } + } + + + } catch (Exception e) { + System.err.println("Error: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeWithPhraseListSample.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeWithPhraseListSample.java new file mode 100644 index 000000000000..af07db34935e --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeWithPhraseListSample.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.PhraseListOptions; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.KeyCredential; +import com.azure.core.util.BinaryData; + +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; + +/** + * Sample demonstrates using a phrase list to improve recognition accuracy for specific terms. + * + * Phrase lists help the speech service better recognize domain-specific terminology, + * proper nouns, and uncommon words that might otherwise be misrecognized. + */ +public class TranscribeWithPhraseListSample { + public static void main(String[] args) { + String endpoint = System.getenv("SPEECH_ENDPOINT"); + String apiKey = System.getenv("SPEECH_API_KEY"); + + if (endpoint == null || apiKey == null) { + System.err.println("Please set SPEECH_ENDPOINT and SPEECH_API_KEY environment variables"); + return; + } + + System.out.println("Azure AI Speech Transcription - Phrase List Sample"); + System.out.println("====================================================\n"); + + // Create client + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(apiKey)) + .buildClient(); + + try { + // Load audio file + String audioFilePath = "src/samples/assets/sample-audio.wav"; + byte[] audioData = Files.readAllBytes(Paths.get(audioFilePath)); + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Create phrase list with custom terms + // Add phrases that appear in your audio for better recognition + PhraseListOptions phraseListOptions = new PhraseListOptions() + .setPhrases(Arrays.asList( + "Mary", + "El Mundo", + "Secret Garden", + "empleada doméstica", + "habitación" + )) + .setBiasingWeight(5.0); // Weight range: 1.0-20.0 (higher = stronger bias) + + // Create transcription options with phrase list + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setPhraseListOptions(phraseListOptions); + + System.out.println("Custom phrase list:"); + phraseListOptions.getPhrases().forEach(phrase -> + System.out.println(" - " + phrase) + ); + System.out.println("\nBiasing weight: " + phraseListOptions.getBiasingWeight()); + System.out.println("\nTranscribing with phrase list...\n"); + + // Transcribe + TranscriptionResult result = client.transcribe(options); + + System.out.println("Transcription result:"); + System.out.println("---------------------"); + result.getCombinedPhrases().forEach(phrase -> + System.out.println(phrase.getText()) + ); + + // Print individual phrases with timing information + if (result.getPhrases() != null && !result.getPhrases().isEmpty()) { + System.out.println("\nDetailed phrases:"); + result.getPhrases().forEach(phrase -> + System.out.println(String.format(" [%dms]: %s", + phrase.getOffset(), + phrase.getText())) + ); + } + + System.out.println("\n Transcription completed successfully!"); + + } catch (Exception e) { + System.err.println("Error: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeWithProfanityFilterSample.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeWithProfanityFilterSample.java new file mode 100644 index 000000000000..40a67d1b0188 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/TranscribeWithProfanityFilterSample.java @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.ProfanityFilterMode; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.KeyCredential; +import com.azure.core.util.BinaryData; + +import java.nio.file.Files; +import java.nio.file.Paths; + +/** + * Sample demonstrates profanity filtering in Azure AI Speech Transcription. + * Shows the difference between NONE (raw), MASKED (f***), REMOVED (omitted), and TAGS (XML tagged). + */ +public class TranscribeWithProfanityFilterSample { + /** + * Main method to run the profanity filter sample. + * + * @param args command line arguments (not used) + */ + public static void main(String[] args) { + System.out.println("Azure AI Speech Transcription - Profanity Filter Sample"); + System.out.println("==========================================================\n"); + + String endpoint = System.getenv("SPEECH_ENDPOINT"); + String apiKey = System.getenv("SPEECH_API_KEY"); + + if (endpoint == null || apiKey == null) { + System.err.println("Please set SPEECH_ENDPOINT and SPEECH_API_KEY environment variables"); + return; + } + + try { + // Create the transcription client + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(apiKey)) + .buildClient(); + + // Load audio file + String audioFilePath = "src/samples/assets/sample-profanity.wav"; + byte[] audioData = Files.readAllBytes(Paths.get(audioFilePath)); + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Demonstrate different profanity filter modes + ProfanityFilterMode[] modes = { + ProfanityFilterMode.NONE, + ProfanityFilterMode.MASKED, + ProfanityFilterMode.REMOVED, + ProfanityFilterMode.TAGS + }; + + for (ProfanityFilterMode mode : modes) { + System.out.println("Transcribing with profanity filter mode: " + mode); + System.out.println("----------------------------------------------"); + + // Create transcription options with profanity filter + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setProfanityFilterMode(mode); + + // Perform transcription + TranscriptionResult result = client.transcribe(options); + + // Display results + System.out.println("Combined text: " + result.getCombinedPhrases().get(0).getText()); + System.out.println(); + } + + + } catch (Exception e) { + System.err.println("Error during transcription: " + e.getMessage()); + e.printStackTrace(); + } + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/javadoccodesnippets/TranscriptionAsyncClientJavaDocCodeSnippets.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/javadoccodesnippets/TranscriptionAsyncClientJavaDocCodeSnippets.java new file mode 100644 index 000000000000..5dc618dee834 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/javadoccodesnippets/TranscriptionAsyncClientJavaDocCodeSnippets.java @@ -0,0 +1,215 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Source code snippets from this file are embedded in Transcription SDK JavaDoc (API documentation). + +package com.azure.ai.speech.transcription.javadoccodesnippets; + +import com.azure.ai.speech.transcription.TranscriptionAsyncClient; +import com.azure.ai.speech.transcription.TranscriptionClientBuilder; +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.ProfanityFilterMode; +import com.azure.ai.speech.transcription.models.TranscriptionDiarizationOptions; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.KeyCredential; +import com.azure.core.util.BinaryData; +import reactor.core.publisher.Mono; + +import java.nio.file.Files; +import java.nio.file.Paths; +import java.time.Duration; +import java.util.Arrays; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +/** + * Code snippets for {@link TranscriptionAsyncClient} JavaDoc documentation. + */ +public class TranscriptionAsyncClientJavaDocCodeSnippets { + + private static String endpoint = System.getenv("SPEECH_ENDPOINT"); + private static String key = System.getenv("SPEECH_API_KEY"); + + /** + * Sample for creating an asynchronous TranscriptionAsyncClient with API key authentication. + */ + public void createAsyncClientWithApiKey() { + // BEGIN: com.azure.ai.speech.transcription.transcriptionasyncclient.instantiation.apikey + TranscriptionAsyncClient asyncClient = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildAsyncClient(); + // END: com.azure.ai.speech.transcription.transcriptionasyncclient.instantiation.apikey + } + + /** + * Sample for transcribing audio asynchronously using subscribe pattern. + */ + public void transcribeAsyncWithSubscribe() throws Exception { + TranscriptionAsyncClient asyncClient = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildAsyncClient(); + + byte[] audioData = Files.readAllBytes(Paths.get("sample.wav")); + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe.subscribe + CountDownLatch latch = new CountDownLatch(1); + + asyncClient.transcribe(options) + .subscribe( + // onNext: Process result + result -> { + System.out.println("Duration: " + result.getDuration() + " ms"); + if (result.getCombinedPhrases() != null) { + result.getCombinedPhrases().forEach(phrase -> + System.out.println("Text: " + phrase.getText()) + ); + } + latch.countDown(); + }, + // onError: Handle error + error -> { + System.err.println("Error: " + error.getMessage()); + latch.countDown(); + }, + // onComplete: Completion handler + () -> System.out.println("Transcription completed") + ); + + latch.await(60, TimeUnit.SECONDS); + // END: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe.subscribe + } + + /** + * Sample for transcribing audio asynchronously using block pattern. + */ + public void transcribeAsyncWithBlock() throws Exception { + TranscriptionAsyncClient asyncClient = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildAsyncClient(); + + byte[] audioData = Files.readAllBytes(Paths.get("sample.wav")); + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe.block + // Use block() to convert async call to sync + TranscriptionResult result = asyncClient.transcribe(options).block(); + + if (result != null) { + System.out.println("Duration: " + result.getDuration() + " ms"); + } + // END: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe.block + } + + /** + * Sample for transcribing audio asynchronously with advanced options. + */ + public void transcribeAsyncWithOptions() throws Exception { + TranscriptionAsyncClient asyncClient = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildAsyncClient(); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe.options + byte[] audioData = Files.readAllBytes(Paths.get("sample.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Configure advanced transcription options + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setLocales(Arrays.asList("en-US", "es-ES")) + .setProfanityFilterMode(ProfanityFilterMode.MASKED) + .setDiarizationOptions(new TranscriptionDiarizationOptions().setMaxSpeakers(5)); + + // Transcribe asynchronously + Mono resultMono = asyncClient.transcribe(options); + + // Process result + resultMono.subscribe(result -> { + if (result.getPhrases() != null) { + result.getPhrases().forEach(phrase -> { + System.out.printf("Speaker %d: %s%n", + phrase.getSpeaker(), phrase.getText()); + }); + } + }); + // END: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe.options + } + + /** + * Sample for transcribing audio asynchronously with timeout and error handling. + */ + public void transcribeAsyncWithTimeoutAndErrorHandling() throws Exception { + TranscriptionAsyncClient asyncClient = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildAsyncClient(); + + byte[] audioData = Files.readAllBytes(Paths.get("sample.wav")); + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe.timeout + Mono resultMono = asyncClient.transcribe(options) + .timeout(Duration.ofMinutes(2)) + .doOnError(error -> System.err.println("Error: " + error.getMessage())) + .onErrorResume(error -> { + System.err.println("Fallback: Returning empty result"); + return Mono.empty(); + }); + + TranscriptionResult result = resultMono.block(); + // END: com.azure.ai.speech.transcription.transcriptionasyncclient.transcribe.timeout + } + + /** + * Sample for processing detailed async transcription results. + */ + public void processDetailedAsyncResults() throws Exception { + TranscriptionAsyncClient asyncClient = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildAsyncClient(); + + byte[] audioData = Files.readAllBytes(Paths.get("sample.wav")); + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionasyncclient.results.detailed + asyncClient.transcribe(options) + .subscribe(result -> { + // Access combined phrases + if (result.getCombinedPhrases() != null) { + result.getCombinedPhrases().forEach(channelPhrase -> + System.out.printf("[Channel %d] %s%n", + channelPhrase.getChannel(), channelPhrase.getText()) + ); + } + + // Access detailed phrases with word-level timing + if (result.getPhrases() != null) { + result.getPhrases().forEach(phrase -> { + System.out.printf("Phrase (%.2f-%.2fs): %s%n", + phrase.getOffset() / 1000.0, + (phrase.getOffset() + phrase.getDuration().toMillis()) / 1000.0, + phrase.getText()); + + if (phrase.getWords() != null) { + phrase.getWords().forEach(word -> + System.out.printf(" \"%s\" at %.2fs%n", + word.getText(), + word.getOffset() / 1000.0) + ); + } + }); + } + }); + // END: com.azure.ai.speech.transcription.transcriptionasyncclient.results.detailed + } +} + diff --git a/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/javadoccodesnippets/TranscriptionClientJavaDocCodeSnippets.java b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/javadoccodesnippets/TranscriptionClientJavaDocCodeSnippets.java new file mode 100644 index 000000000000..cc9ebd2c57fc --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/samples/java/com/azure/ai/speech/transcription/javadoccodesnippets/TranscriptionClientJavaDocCodeSnippets.java @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Source code snippets from this file are embedded in Transcription SDK JavaDoc (API documentation). + +package com.azure.ai.speech.transcription.javadoccodesnippets; + +import com.azure.ai.speech.transcription.TranscriptionClient; +import com.azure.ai.speech.transcription.TranscriptionClientBuilder; +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.ProfanityFilterMode; +import com.azure.ai.speech.transcription.models.TranscriptionDiarizationOptions; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.util.BinaryData; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Arrays; + +/** + * Code snippets for {@link TranscriptionClient} JavaDoc documentation. + */ +public class TranscriptionClientJavaDocCodeSnippets { + + private static String endpoint = System.getenv("SPEECH_ENDPOINT"); + private static String key = System.getenv("SPEECH_API_KEY"); + + /** + * Sample for creating a synchronous TranscriptionClient with API key authentication. + */ + public void createClientWithApiKey() { + // BEGIN: com.azure.ai.speech.transcription.transcriptionclient.instantiation.apikey + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildClient(); + // END: com.azure.ai.speech.transcription.transcriptionclient.instantiation.apikey + } + + /** + * Sample for creating a synchronous TranscriptionClient with Entra ID authentication. + */ + public void createClientWithTokenCredential() { + // BEGIN: com.azure.ai.speech.transcription.transcriptionclient.instantiation.tokencredential + // Use DefaultAzureCredential for Entra ID authentication + TokenCredential credential = new DefaultAzureCredentialBuilder().build(); + + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(credential) + .buildClient(); + // END: com.azure.ai.speech.transcription.transcriptionclient.instantiation.tokencredential + } + + /** + * Sample for transcribing audio from a file with default options. + */ + public void transcribeFromFile() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildClient(); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionclient.transcribe.file + // Read audio file + byte[] audioData = Files.readAllBytes(Paths.get("sample.wav")); + + // Create audio file details + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Create transcription options using the AudioFileDetails constructor + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + + // Transcribe audio + TranscriptionResult result = client.transcribe(options); + + // Process results + System.out.println("Duration: " + result.getDuration() + " ms"); + result.getCombinedPhrases().forEach(phrase -> { + System.out.println("Channel " + phrase.getChannel() + ": " + phrase.getText()); + }); + // END: com.azure.ai.speech.transcription.transcriptionclient.transcribe.file + } + + /** + * Sample for transcribing audio with advanced options. + */ + public void transcribeWithOptions() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildClient(); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionclient.transcribe.options + byte[] audioData = Files.readAllBytes(Paths.get("sample.wav")); + + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + + // Configure advanced transcription options + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails) + .setLocales(Arrays.asList("en-US", "es-ES")) + .setProfanityFilterMode(ProfanityFilterMode.MASKED) + .setDiarizationOptions(new TranscriptionDiarizationOptions().setMaxSpeakers(5)); + + TranscriptionResult result = client.transcribe(options); + + // Access detailed results + if (result.getPhrases() != null) { + result.getPhrases().forEach(phrase -> { + System.out.printf("Speaker %d: %s%n", + phrase.getSpeaker(), phrase.getText()); + }); + } + // END: com.azure.ai.speech.transcription.transcriptionclient.transcribe.options + } + + /** + * Sample for processing detailed transcription results with word-level timing. + */ + public void processDetailedResults() throws Exception { + TranscriptionClient client = new TranscriptionClientBuilder() + .endpoint(endpoint) + .credential(new KeyCredential(key)) + .buildClient(); + + byte[] audioData = Files.readAllBytes(Paths.get("sample.wav")); + AudioFileDetails audioFileDetails = new AudioFileDetails(BinaryData.fromBytes(audioData)); + TranscriptionOptions options = new TranscriptionOptions(audioFileDetails); + TranscriptionResult result = client.transcribe(options); + + // BEGIN: com.azure.ai.speech.transcription.transcriptionclient.results.detailed + // Access sentence-level combined phrases + if (result.getCombinedPhrases() != null) { + result.getCombinedPhrases().forEach(channelPhrase -> { + System.out.printf("[Channel %d] %s%n", + channelPhrase.getChannel(), channelPhrase.getText()); + }); + } + + // Access word-level details with timing + if (result.getPhrases() != null) { + result.getPhrases().forEach(phrase -> { + System.out.printf("Phrase (%.2f-%.2fs): %s%n", + phrase.getOffset() / 1000.0, + (phrase.getOffset() + phrase.getDuration().toMillis()) / 1000.0, + phrase.getText()); + + // Get word-level timing information + if (phrase.getWords() != null) { + phrase.getWords().forEach(word -> { + System.out.printf(" Word: \"%s\" at %.2fs%n", + word.getText(), + word.getOffset() / 1000.0); + }); + } + }); + } + // END: com.azure.ai.speech.transcription.transcriptionclient.results.detailed + } +} + diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/README.md b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/README.md new file mode 100644 index 000000000000..353f2605ba20 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/README.md @@ -0,0 +1,214 @@ +# Azure AI Speech Transcription client library tests for Java + +This directory contains tests for the Azure AI Speech Transcription client library for Java. + +## Test Structure + +The tests are organized as follows: + +- **TranscriptionClientTestBase.java**: Base class containing common test infrastructure, helper methods, and validation logic. Includes support for both file-based and URL-based transcription. +- **TranscriptionClientTest.java**: Tests for the synchronous `TranscriptionClient` (14 tests) +- **TranscriptionAsyncClientTest.java**: Tests for the asynchronous `TranscriptionAsyncClient` (16 tests) +- **generated/**: Auto-generated test templates (for reference only) + +## Prerequisites + +Before running the tests, you need: + +1. An Azure Cognitive Services Speech resource. Create one using the [Azure Portal](https://portal.azure.com/). +2. Java Development Kit (JDK) 8 or later +3. Maven 3.x or later +4. A sample audio file for testing (WAV, MP3, or OGG format, shorter than 2 hours, smaller than 250 MB) + +## Set Environment Variables + +Set the following environment variables to run live tests: + +### Windows (PowerShell) + +```powershell +$env:SPEECH_ENDPOINT = "https://.cognitiveservices.azure.com" +$env:SPEECH_API_KEY = "" +``` + +### Windows (Command Prompt) + +```cmd +set SPEECH_ENDPOINT=https://.cognitiveservices.azure.com +set SPEECH_API_KEY= +``` + +### Linux/macOS (Bash) + +```bash +export SPEECH_ENDPOINT="https://.cognitiveservices.azure.com" +export SPEECH_API_KEY="" +``` + +## Configure Test Proxy + +The Azure SDK for Java uses a test proxy for recording and playing back HTTP interactions. This library has been migrated to use the test proxy following the [Test Proxy Migration Guide](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-test/TestProxyMigrationGuide.md). + +Test recordings are stored in the [azure-sdk-assets](https://github.com/Azure/azure-sdk-assets) repository and referenced via the `assets.json` file. Configure the test mode by setting the `AZURE_TEST_MODE` environment variable: + +### Live Mode (against live service) + +```powershell +$env:AZURE_TEST_MODE = "LIVE" +``` + +This mode makes real HTTP calls to the Azure service. Use this when you want to test against the actual service. + +### Record Mode (record interactions) + +```powershell +$env:AZURE_TEST_MODE = "RECORD" +``` + +This mode makes real HTTP calls and records them for later playback. Recordings are managed by the test-proxy tool and can be pushed to the azure-sdk-assets repository using: + +```bash +test-proxy push -a assets.json +``` + +### Playback Mode (use recordings) + +```powershell +$env:AZURE_TEST_MODE = "PLAYBACK" +``` + +This mode uses previously recorded HTTP interactions instead of making real calls. This is the default mode and doesn't require credentials. + +## Running Tests + +### Run All Tests + +From the `sdk/transcription/azure-ai-speech-transcription` directory: + +```bash +mvn clean test +``` + +### Run Specific Test Class + +```bash +mvn test -Dtest=TranscriptionClientTest +``` + +or + +```bash +mvn test -Dtest=TranscriptionAsyncClientTest +``` + +### Run a Specific Test Method + +```bash +mvn test -Dtest=TranscriptionClientTest#testTranscribeSyncBasicFromFile +``` + +## Test Organization + +### Synchronous Tests (TranscriptionClientTest) + +Tests for the synchronous `TranscriptionClient` (14 tests), including: + +- Basic transcription from file +- Transcription from URL (using publicly accessible audio URL) +- Transcription with language specification +- Transcription with multiple languages +- Transcription with speaker diarization +- Transcription with profanity filtering +- Transcription with word-level timestamps +- Tests using `transcribeWithResponse()` method +- Tests with custom RequestOptions + +### Asynchronous Tests (TranscriptionAsyncClientTest) + +Tests for the asynchronous `TranscriptionAsyncClient` (16 tests), mirroring the synchronous tests but using reactive programming patterns with `Mono` and `Flux`. Includes additional tests for: + +- Transcription from URL (using publicly accessible audio URL) +- Error handling with invalid language codes +- Placeholder tests for empty audio data and cancellation scenarios + +## Authentication + +The tests support two authentication methods: + +1. **Key-based authentication** (default): Uses the API key from `SPEECH_API_KEY` environment variable +2. **Token-based authentication**: Uses Entra ID credentials via `DefaultAzureCredential` + +To test with token-based authentication, some tests use `createClient(false, true, sync)` where the first parameter is `false`. + +## Troubleshooting + +### Common Issues + +1. **Missing environment variables**: Ensure `SPEECH_ENDPOINT` and `SPEECH_API_KEY` are set correctly +2. **Missing sample audio file**: Make sure you have a `sample.wav` file in the test directory (WAV, MP3, or OGG format, shorter than 2 hours, smaller than 250 MB) +3. **URL transcription failures**: URL-based transcription requires a specific API key tier that supports this feature. If URL tests fail with 401 errors, verify your Speech resource supports URL transcription. +4. **Test proxy issues**: If playback tests fail, try running in LIVE or RECORD mode first to regenerate recordings +5. **Network issues**: Check your network connection and firewall settings + +### Enable Detailed Logging + +To enable detailed HTTP logging during tests, set the logging level in your `logback-test.xml` or via environment variables: + +```powershell +$env:AZURE_LOG_LEVEL = "verbose" +``` + +## Additional Resources + +- [Azure SDK for Java Test Documentation](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-test/README.md) +- [TypeSpec Java QuickStart - Adding Tests](https://github.com/Azure/azure-sdk-for-java/wiki/TypeSpec-Java-QuickStart#adding-tests) +- [Azure Speech Service Documentation](https://learn.microsoft.com/azure/cognitive-services/speech-service/) +- [Azure SDK for Java Contributing Guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md) + +## Test Coverage + +The current tests cover: + +- ✅ Client instantiation with different authentication methods +- ✅ Basic transcription functionality from files +- ✅ Transcription from publicly accessible URLs +- ✅ Transcription with various options (language, diarization, profanity filter, timestamps) +- ✅ Both synchronous and asynchronous clients +- ✅ Methods with and without `Response` wrappers +- ✅ Custom RequestOptions and headers +- ✅ Error handling (invalid language codes) + +Areas for future enhancement: + +- ⏳ Empty audio data handling (placeholder test exists) +- ⏳ Cancellation scenarios (placeholder test exists) +- ⬜ Performance tests +- ⬜ Concurrent request handling +- ⬜ Edge cases (very long audio, multiple channels, etc.) + +## Recording Sanitizers + +The tests use the test-proxy's built-in sanitizers to automatically redact sensitive information from recordings: + +- API keys and authentication tokens +- Connection strings and passwords +- Account names and identifiers +- Hostnames in URLs + +Some default sanitizers (AZSDK2003, AZSDK2030, AZSDK3430, AZSDK3493) are explicitly removed to preserve resource identifiers needed for proper request matching during playback. + +## Managing Test Recordings + +### Restore recordings from assets repo + +```bash +test-proxy restore -a assets.json +``` + +### Push new recordings to assets repo + +```bash +test-proxy push -a assets.json +``` + +This creates a new tag in the azure-sdk-assets repository and updates `assets.json` with the new tag reference. diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/TranscriptionAsyncClientTest.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/TranscriptionAsyncClientTest.java new file mode 100644 index 000000000000..c7caaaf99383 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/TranscriptionAsyncClientTest.java @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.models.ProfanityFilterMode; +import com.azure.ai.speech.transcription.models.TranscriptionDiarizationOptions; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.exception.HttpResponseException; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import reactor.test.StepVerifier; + +import java.util.Arrays; +import java.util.Collections; + +import static org.junit.jupiter.api.Assertions.fail; + +/** + * Tests for TranscriptionAsyncClient (asynchronous client). + */ +class TranscriptionAsyncClientTest extends TranscriptionClientTestBase { + private TranscriptionAsyncClient client; + + @BeforeEach + public void setupTest() { + this.client = configureBuilder(true, true).buildAsyncClient(); + } + + /*********************************************************************************** + * + * HAPPY PATH TESTS + * + ***********************************************************************************/ + + @Test + public void testTranscribeAsyncBasicFromFile() { + transcribeAndVerifyResult("testTranscribeAsyncBasicFromFile", fromAudioFile()); + } + + @Test + public void testTranscribeAsyncWithLanguageFromFile() { + transcribeAndVerifyResult("testTranscribeAsyncWithLanguageFromFile", + fromAudioFile().setLocales(Collections.singletonList("en-US"))); + } + + @Test + public void testTranscribeAsyncWithMultipleLanguagesFromFile() { + transcribeAndVerifyResult("testTranscribeAsyncWithMultipleLanguagesFromFile", + fromAudioFile().setLocales(Arrays.asList("en-US", "es-ES", "fr-FR"))); + } + + @Test + public void testTranscribeAsyncWithDiarizationFromFile() { + transcribeAndVerifyResult("testTranscribeAsyncWithDiarizationFromFile", + fromAudioFile().setDiarizationOptions(new TranscriptionDiarizationOptions().setMaxSpeakers(5))); + } + + @Test + public void testTranscribeAsyncWithProfanityFilterFromFile() { + transcribeAndVerifyResult("testTranscribeAsyncWithProfanityFilterFromFile", + fromAudioFile().setProfanityFilterMode(ProfanityFilterMode.MASKED)); + } + + @Test + public void testTranscribeAsyncWithChannelsFromFile() { + transcribeAndVerifyResult("testTranscribeAsyncWithChannelsFromFile", + fromAudioFile().setActiveChannels(Collections.singletonList(0))); + } + + @Test + public void testTranscribeAsyncAllOptionsFromFile() { + TranscriptionOptions options = fromAudioFile().setLocales(Collections.singletonList("en-US")) + .setDiarizationOptions(new TranscriptionDiarizationOptions().setMaxSpeakers(5)) + .setProfanityFilterMode(ProfanityFilterMode.MASKED) + .setActiveChannels(Collections.singletonList(0)); + + transcribeAndVerifyResult("testTranscribeAsyncAllOptionsFromFile", options); + } + + @Test + public void testTranscribeAsyncBasicFromFileWithResponse() { + transcribeAndVerifyResponse("testTranscribeAsyncBasicFromFileWithResponse", fromAudioFile(), + new RequestOptions().addHeader(HttpHeaderName.fromString("x-custom-header"), "custom-value")); + } + + @Test + public void testTranscribeAsyncWithAllOptionsFromFileWithResponse() { + TranscriptionOptions options = fromAudioFile().setLocales(Arrays.asList("en-US", "es-ES")) + .setDiarizationOptions(new TranscriptionDiarizationOptions().setMaxSpeakers(5)) + .setProfanityFilterMode(ProfanityFilterMode.REMOVED) + .setActiveChannels(Arrays.asList(0, 1)); + + RequestOptions requestOptions + = new RequestOptions().addHeader(HttpHeaderName.fromString("x-custom-header"), "custom-value") + .addQueryParam("test-param", "test-value"); + + transcribeAndVerifyResponse("testTranscribeAsyncWithAllOptionsFromFileWithResponse", options, requestOptions); + } + + @Test + public void testTranscribeAsyncWithAudioUrl() { + // Using a publicly accessible sample audio file from Azure samples + String audioUrl + = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-speech-sdk/master/sampledata/audiofiles/aboutSpeechSdk.wav"; + + transcribeAndVerifyResult("testTranscribeAsyncWithAudioUrl", + new TranscriptionOptions(audioUrl).setLocales(Collections.singletonList("en-US"))); + } + + @Test + public void testTranscribeAsyncWithProfanityModeMasked() { + transcribeAndVerifyResult("testTranscribeAsyncWithProfanityModeMasked", + fromAudioFile().setProfanityFilterMode(ProfanityFilterMode.MASKED)); + } + + @Test + public void testTranscribeAsyncWithProfanityModeRemoved() { + transcribeAndVerifyResult("testTranscribeAsyncWithProfanityModeTags", + fromAudioFile().setProfanityFilterMode(ProfanityFilterMode.REMOVED)); + } + + @Test + public void testTranscribeAsyncWithProfanityModeTags() { + transcribeAndVerifyResult("testTranscribeAsyncWithProfanityModeTags", + fromAudioFile().setProfanityFilterMode(ProfanityFilterMode.TAGS)); + } + + /*********************************************************************************** + * + * ERROR HANDLING TESTS + * + ***********************************************************************************/ + + @Test + public void testTranscribeAsyncWithEmptyAudioData() { + // Test with minimal audio data - service should handle gracefully + transcribeAndVerifyResult("testTranscribeAsyncWithEmptyAudioData", fromAudioFile()); + } + + @Test + public void testTranscribeAsyncWithInvalidLanguageCode() { + // Use invalid language code to trigger service error + TranscriptionOptions options = fromAudioFile().setLocales(Collections.singletonList("invalid-locale-code")); + + // The service should return a 400 error for invalid locale + // doTranscription wraps exceptions in RuntimeException, so we catch that + StepVerifier.create(client.transcribe(options)).verifyErrorSatisfies(e -> { + // Expected behavior - verify the cause is HttpResponseException with 400 status + if (!(e instanceof HttpResponseException)) { + fail("Expected RuntimeException cause to be HttpResponseException but got: " + e.getClass()); + } + HttpResponseException httpException = (HttpResponseException) e; + if (httpException.getResponse().getStatusCode() != 400) { + fail("Expected 400 status code but got: " + httpException.getResponse().getStatusCode()); + } + }); + } + + @Test + public void testTranscribeAsyncCancellation() { + // Test cancellation behavior with a normal transcription request + transcribeAndVerifyResult("testTranscribeAsyncCancellation", fromAudioFile()); + } + + private void transcribeAndVerifyResult(String testName, TranscriptionOptions options) { + StepVerifier.create(client.transcribe(options)) + .assertNext(result -> validateTranscriptionResult(testName, result)) + .verifyComplete(); + } + + private void transcribeAndVerifyResponse(String testName, TranscriptionOptions options, + RequestOptions requestOptions) { + BinaryData multipartBody = createMultipartBody(options, requestOptions); + StepVerifier.create(client.transcribeWithResponse(multipartBody, requestOptions)).assertNext(response -> { + printHttpRequestAndResponse(response); + validateTranscriptionResult(testName, response.getValue().toObject(TranscriptionResult.class)); + }).verifyComplete(); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/TranscriptionClientTest.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/TranscriptionClientTest.java new file mode 100644 index 000000000000..bfa8eea77130 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/TranscriptionClientTest.java @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.models.ProfanityFilterMode; +import com.azure.ai.speech.transcription.models.TranscriptionDiarizationOptions; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.util.BinaryData; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.Collections; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +/** + * Tests for TranscriptionClient (synchronous client). + */ +class TranscriptionClientTest extends TranscriptionClientTestBase { + private TranscriptionClient client; + + @BeforeEach + public void setupTest() { + this.client = configureBuilder(true, true).buildClient(); + } + + /*********************************************************************************** + * + * HAPPY PATH TESTS + * + ***********************************************************************************/ + + @Test + public void testTranscribeSyncBasicFromFile() { + transcribeAndVerifyResult("testTranscribeSyncBasicFromFile", fromAudioFile()); + } + + @Test + public void testTranscribeSyncWithLanguageFromFile() { + transcribeAndVerifyResult("testTranscribeSyncWithLanguageFromFile", + fromAudioFile().setLocales(Collections.singletonList("en-US"))); + } + + @Test + public void testTranscribeSyncWithMultipleLanguagesFromFile() { + transcribeAndVerifyResult("testTranscribeSyncWithMultipleLanguagesFromFile", + fromAudioFile().setLocales(Arrays.asList("en-US", "es-ES", "fr-FR"))); + } + + @Test + public void testTranscribeSyncWithDiarizationFromFile() { + transcribeAndVerifyResult("testTranscribeSyncWithDiarizationFromFile", + fromAudioFile().setDiarizationOptions(new TranscriptionDiarizationOptions().setMaxSpeakers(5))); + } + + @Test + public void testTranscribeSyncWithProfanityFilterFromFile() { + transcribeAndVerifyResult("testTranscribeSyncWithProfanityFilterFromFile", + fromAudioFile().setProfanityFilterMode(ProfanityFilterMode.MASKED)); + } + + @Test + public void testTranscribeSyncWithChannelsFromFile() { + transcribeAndVerifyResult("testTranscribeSyncWithChannelsFromFile", + fromAudioFile().setActiveChannels(Collections.singletonList(0))); + } + + @Test + public void testTranscribeSyncAllOptionsFromFile() { + TranscriptionOptions options = fromAudioFile().setLocales(Collections.singletonList("en-US")) + .setDiarizationOptions(new TranscriptionDiarizationOptions().setMaxSpeakers(5)) + .setProfanityFilterMode(ProfanityFilterMode.MASKED) + .setActiveChannels(Collections.singletonList(0)); + + transcribeAndVerifyResult("testTranscribeSyncAllOptionsFromFile", options); + } + + @Test + public void testTranscribeSyncBasicFromFileWithResponse() { + transcribeAndVerifyResponse("testTranscribeSyncBasicFromFileWithResponse", fromAudioFile(), + new RequestOptions().addHeader(HttpHeaderName.fromString("x-custom-header"), "custom-value")); + } + + @Test + public void testTranscribeSyncWithAllOptionsFromFileWithResponse() { + TranscriptionOptions options = fromAudioFile().setLocales(Arrays.asList("en-US", "es-ES")) + .setDiarizationOptions(new TranscriptionDiarizationOptions().setMaxSpeakers(5)) + .setProfanityFilterMode(ProfanityFilterMode.REMOVED) + .setActiveChannels(Arrays.asList(0, 1)); + + RequestOptions requestOptions + = new RequestOptions().addHeader(HttpHeaderName.fromString("x-custom-header"), "custom-value") + .addQueryParam("test-param", "test-value"); + + transcribeAndVerifyResponse("testTranscribeSyncWithAllOptionsFromFileWithResponse", options, requestOptions); + } + + @Test + public void testTranscribeSyncWithMultipleChannels() { + // Test with multiple channel indices + transcribeAndVerifyResult("testTranscribeSyncWithMultipleChannels", + fromAudioFile().setActiveChannels(Arrays.asList(0, 1))); + } + + @Test + public void testTranscribeSyncWithAudioUrl() { + // Using a publicly accessible sample audio file from Azure samples + String audioUrl + = "https://raw.githubusercontent.com/Azure-Samples/cognitive-services-speech-sdk/master/sampledata/audiofiles/aboutSpeechSdk.wav"; + + transcribeAndVerifyResult("testTranscribeSyncWithAudioUrl", + new TranscriptionOptions(audioUrl).setLocales(Collections.singletonList("en-US"))); + } + + /*********************************************************************************** + * + * ERROR HANDLING TESTS + * + ***********************************************************************************/ + + @Test + public void testTranscribeSyncWithNullOptions() { + // Test that null options throws appropriate exception + assertThrows(NullPointerException.class, () -> client.transcribe((TranscriptionOptions) null), + "Transcribe should throw NullPointerException when options is null"); + } + + @Test + public void testTranscribeSyncWithEmptyAudioData() { + // Test with empty audio data - this should result in a service error + // Note: Depending on service behavior, this may throw HttpResponseException + // The exact behavior should be validated based on actual service responses + } + + @Test + public void testTranscribeSyncWithInvalidLanguageCode() { + // Note: This test requires actual service call to verify behavior + // In PLAYBACK mode, this would replay the recorded error response + // Example implementation: + // TranscriptionOptions options = new TranscriptionOptions((String) null) + // .setLocales(Arrays.asList("invalid-locale")); + // doTranscription(methodName, sync, false, audioFile, options, null); + // The service should return an error for invalid locale + } + + private void transcribeAndVerifyResult(String testName, TranscriptionOptions options) { + validateTranscriptionResult(testName, client.transcribe(options)); + } + + private void transcribeAndVerifyResponse(String testName, TranscriptionOptions options, + RequestOptions requestOptions) { + BinaryData multipartBody = createMultipartBody(options, requestOptions); + Response response = client.transcribeWithResponse(multipartBody, requestOptions); + printHttpRequestAndResponse(response); + validateTranscriptionResult(testName, response.getValue().toObject(TranscriptionResult.class)); + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/TranscriptionClientTestBase.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/TranscriptionClientTestBase.java new file mode 100644 index 000000000000..10f0417e118b --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/TranscriptionClientTestBase.java @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.azure.ai.speech.transcription; + +import com.azure.ai.speech.transcription.implementation.MultipartFormDataHelper; +import com.azure.ai.speech.transcription.models.AudioFileDetails; +import com.azure.ai.speech.transcription.models.TranscriptionOptions; +import com.azure.ai.speech.transcription.models.TranscriptionResult; +import com.azure.core.credential.KeyCredential; +import com.azure.core.credential.TokenCredential; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.http.rest.RequestOptions; +import com.azure.core.http.rest.Response; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.util.BinaryData; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Files; +import java.nio.file.Paths; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Base class for TranscriptionClient tests. Contains helper methods and common test infrastructure. + * Supports both API Key (KeyCredential) and Entra ID (TokenCredential) authentication. + */ +class TranscriptionClientTestBase extends TestProxyTestBase { + private static final boolean PRINT_RESULTS = false; // Set to true to print results to console window + + private static final String SAMPLE_WAV_FILE_NAME = "sample.wav"; + private static final byte[] SAMPLE_WAV; + + static { + try { + SAMPLE_WAV = Files.readAllBytes(Paths + .get(TranscriptionClientTestBase.class.getClassLoader().getResource(SAMPLE_WAV_FILE_NAME).toURI())); + } catch (URISyntaxException | IOException ex) { + throw new RuntimeException("Failed to load audio file for testing.", ex); + } + } + + /** + * Configures a {@link TranscriptionClientBuilder} that will be used to create the specific sync or async client for + * testing. + * + * @param useKeyAuth Whether to use key-based authentication (true) or token-based authentication (false) + * @param useRealKey Whether to use a real key from environment variables (true) or a fake key (false). + * Only applies when useKeyAuth is true. + */ + protected TranscriptionClientBuilder configureBuilder(boolean useKeyAuth, boolean useRealKey) { + // Define endpoint and auth credentials + String endpoint = "https://fake-resource-name.cognitiveservices.azure.com"; + String key = "00000000000000000000000000000000"; + + if (!interceptorManager.isPlaybackMode()) { + endpoint = Configuration.getGlobalConfiguration().get("SPEECH_ENDPOINT"); + assertTrue(endpoint != null && !endpoint.isEmpty(), "Endpoint URL is required to run live tests."); + + if (useKeyAuth && useRealKey) { + key = Configuration.getGlobalConfiguration().get("SPEECH_API_KEY"); + assertTrue(key != null && !key.isEmpty(), "API key is required to run live tests with KeyCredential."); + } + } + + // Create the client builder + TranscriptionClientBuilder transcriptionClientBuilder = new TranscriptionClientBuilder().endpoint(endpoint) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BODY_AND_HEADERS)); + + // Update the client builder with credentials and recording/playback policies + if (interceptorManager.isLiveMode()) { + if (useKeyAuth) { + transcriptionClientBuilder.credential(new KeyCredential(key)); + } else { + // Use Entra ID authentication (TokenCredential) + TokenCredential credential = new DefaultAzureCredentialBuilder().build(); + transcriptionClientBuilder.credential(credential); + } + } else if (interceptorManager.isRecordMode()) { + transcriptionClientBuilder.addPolicy(interceptorManager.getRecordPolicy()); + if (useKeyAuth) { + transcriptionClientBuilder.credential(new KeyCredential(key)); + } else { + TokenCredential credential = new DefaultAzureCredentialBuilder().build(); + transcriptionClientBuilder.credential(credential); + } + } else if (interceptorManager.isPlaybackMode()) { + transcriptionClientBuilder.httpClient(interceptorManager.getPlaybackClient()); + // In playback mode, use a fake key regardless of authentication method + transcriptionClientBuilder.credential(new KeyCredential(key)); + } + + // Configure sanitizers - must be done after registering the record policy or playback client + if (!interceptorManager.isLiveMode()) { + // Remove default sanitizers that would interfere with Speech service recordings: + // - AZSDK3430 (id sanitizer): Preserve resource identifiers needed for request matching + // - AZSDK3493 (name sanitizer): Preserve resource names needed for request matching + // - AZSDK2003, AZSDK2030: URI-related sanitizers that may affect Speech endpoints + interceptorManager.removeSanitizers("AZSDK2003", "AZSDK2030", "AZSDK3430", "AZSDK3493"); + } + + return transcriptionClientBuilder; + } + + protected TranscriptionOptions fromAudioFile() { + return new TranscriptionOptions( + new AudioFileDetails(BinaryData.fromBytes(SAMPLE_WAV)).setFilename(SAMPLE_WAV_FILE_NAME)); + } + + protected BinaryData createMultipartBody(TranscriptionOptions options, RequestOptions requestOptions) { + AudioFileDetails audioFileDetails + = new AudioFileDetails(BinaryData.fromBytes(SAMPLE_WAV)).setFilename(SAMPLE_WAV_FILE_NAME); + + return new MultipartFormDataHelper(requestOptions).serializeJsonField("definition", options) + .serializeFileField("audio", audioFileDetails.getContent(), audioFileDetails.getContentType(), + audioFileDetails.getFilename()) + .end() + .getRequestBody(); + } + + /** + * Validates the transcription result. + * + * @param testName The name of the test + * @param result The transcription result to validate + */ + protected void validateTranscriptionResult(String testName, TranscriptionResult result) { + if (PRINT_RESULTS) { + System.out.println("\n===== Test: " + testName + " ====="); + System.out.println("Duration: " + result.getDuration() + "ms"); + if (result.getCombinedPhrases() != null) { + result.getCombinedPhrases() + .forEach(phrase -> System.out.println("Channel " + phrase.getChannel() + ": " + phrase.getText())); + } + if (result.getPhrases() != null) { + result.getPhrases() + .forEach(phrase -> System.out + .println("Phrase: " + phrase.getText() + " (confidence: " + phrase.getConfidence() + ")")); + } + } + + // Basic validation + assertNotNull(result, "Transcription result should not be null"); + assertNotNull(result.getDuration(), "Duration should not be null"); + assertTrue(result.getDuration().toMillis() > 0, "Duration should be greater than 0"); + assertNotNull(result.getCombinedPhrases(), "Combined phrases should not be null"); + assertFalse(result.getCombinedPhrases().isEmpty(), "Combined phrases should not be empty"); + assertNotNull(result.getPhrases(), "Phrases should not be null"); + assertFalse(result.getPhrases().isEmpty(), "Phrases should not be empty"); + + // Validate combined phrases + result.getCombinedPhrases().forEach(phrase -> { + assertNotNull(phrase.getText(), "Combined phrase text should not be null"); + assertFalse(phrase.getText().isEmpty(), "Combined phrase text should not be empty"); + }); + + // Validate phrases + result.getPhrases().forEach(phrase -> { + assertNotNull(phrase.getText(), "Phrase text should not be null"); + assertFalse(phrase.getText().isEmpty(), "Phrase text should not be empty"); + assertTrue(phrase.getConfidence() >= 0 && phrase.getConfidence() <= 1, + "Confidence should be between 0 and 1"); + assertTrue(phrase.getOffset() >= 0, "Offset should be non-negative"); + assertTrue(phrase.getDuration().toMillis() > 0, "Phrase duration should be positive"); + }); + } + + /** + * Prints HTTP request and response details for debugging. + * + * @param response The HTTP response + */ + protected void printHttpRequestAndResponse(Response response) { + if (PRINT_RESULTS) { + HttpRequest request = response.getRequest(); + System.out.println("\n===== HTTP Request ====="); + System.out.println(request.getHttpMethod() + " " + request.getUrl()); + request.getHeaders().forEach(header -> System.out.println(header.getName() + ": " + header.getValue())); + + System.out.println("\n===== HTTP Response ====="); + System.out.println("Status Code: " + response.getStatusCode()); + response.getHeaders().forEach(header -> System.out.println(header.getName() + ": " + header.getValue())); + } + } + +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscriptionClientTestBase.java b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscriptionClientTestBase.java new file mode 100644 index 000000000000..2e70366d4ec1 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/test/java/com/azure/ai/speech/transcription/generated/TranscriptionClientTestBase.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.ai.speech.transcription.generated; + +// The Java test files under 'generated' package are generated for your reference. +// If you wish to modify these files, please copy them out of the 'generated' package, and modify there. +// See https://aka.ms/azsdk/dpg/java/tests for guide on adding a test. + +import com.azure.ai.speech.transcription.TranscriptionClient; +import com.azure.ai.speech.transcription.TranscriptionClientBuilder; +import com.azure.core.http.policy.HttpLogDetailLevel; +import com.azure.core.http.policy.HttpLogOptions; +import com.azure.core.test.TestMode; +import com.azure.core.test.TestProxyTestBase; +import com.azure.core.test.utils.MockTokenCredential; +import com.azure.core.util.Configuration; +import com.azure.identity.DefaultAzureCredentialBuilder; + +class TranscriptionClientTestBase extends TestProxyTestBase { + protected TranscriptionClient transcriptionClient; + + @Override + protected void beforeTest() { + TranscriptionClientBuilder transcriptionClientbuilder = new TranscriptionClientBuilder() + .endpoint(Configuration.getGlobalConfiguration().get("ENDPOINT", "endpoint")) + .httpClient(getHttpClientOrUsePlayback(getHttpClients().findFirst().orElse(null))) + .httpLogOptions(new HttpLogOptions().setLogLevel(HttpLogDetailLevel.BASIC)); + if (getTestMode() == TestMode.PLAYBACK) { + transcriptionClientbuilder.credential(new MockTokenCredential()); + } else if (getTestMode() == TestMode.RECORD) { + transcriptionClientbuilder.addPolicy(interceptorManager.getRecordPolicy()) + .credential(new DefaultAzureCredentialBuilder().build()); + } else if (getTestMode() == TestMode.LIVE) { + transcriptionClientbuilder.credential(new DefaultAzureCredentialBuilder().build()); + } + transcriptionClient = transcriptionClientbuilder.buildClient(); + + } +} diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/sdk/transcription/azure-ai-speech-transcription/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 000000000000..1f0955d450f0 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline diff --git a/sdk/transcription/azure-ai-speech-transcription/src/test/resources/sample.wav b/sdk/transcription/azure-ai-speech-transcription/src/test/resources/sample.wav new file mode 100644 index 000000000000..bf23d54b0c00 Binary files /dev/null and b/sdk/transcription/azure-ai-speech-transcription/src/test/resources/sample.wav differ diff --git a/sdk/transcription/azure-ai-speech-transcription/tsp-location.yaml b/sdk/transcription/azure-ai-speech-transcription/tsp-location.yaml new file mode 100644 index 000000000000..ed7b497e5fa9 --- /dev/null +++ b/sdk/transcription/azure-ai-speech-transcription/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cognitiveservices/Speech.Transcription +commit: 67019b34b001ae6b8429ee983b9697465d721d0b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/transcription/ci.yml b/sdk/transcription/ci.yml new file mode 100644 index 000000000000..bbf4e187a7f2 --- /dev/null +++ b/sdk/transcription/ci.yml @@ -0,0 +1,46 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: + branches: + include: + - main + - hotfix/* + - release/* + paths: + include: + - sdk/transcription/ci.yml + - sdk/transcription/azure-ai-speech-transcription/ + exclude: + - sdk/transcription/pom.xml + - sdk/transcription/azure-ai-speech-transcription/pom.xml + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/transcription/ci.yml + - sdk/transcription/azure-ai-speech-transcription/ + exclude: + - sdk/transcription/pom.xml + - sdk/transcription/azure-ai-speech-transcription/pom.xml + +parameters: + - name: release_azureaispeechtranscription + displayName: "azure-ai-speech-transcription" + type: boolean + default: true + +extends: + template: ../../eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: transcription + Artifacts: + - name: azure-ai-speech-transcription + groupId: com.azure + safeName: azureaispeechtranscription + releaseInBatch: ${{ parameters.release_azureaispeechtranscription }} diff --git a/sdk/transcription/pom.xml b/sdk/transcription/pom.xml new file mode 100644 index 000000000000..5736ddc377da --- /dev/null +++ b/sdk/transcription/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + com.azure + azure-transcription-service + pom + 1.0.0 + + azure-ai-speech-transcription + + diff --git a/sdk/translation/azure-ai-translation-text/CHANGELOG.md b/sdk/translation/azure-ai-translation-text/CHANGELOG.md index 542660e33105..70a042302e93 100644 --- a/sdk/translation/azure-ai-translation-text/CHANGELOG.md +++ b/sdk/translation/azure-ai-translation-text/CHANGELOG.md @@ -1,10 +1,10 @@ # Release History -## 2.0.0-beta.1 (Unreleased) +## 2.0.0-beta.1 (2026-01-08) ### Features Added -- Added support for the latest Azure AI Translator API, including translations using LLM models, adaptive custom translation, tone variant translations, and gender-specific translations. +- Added support for the Azure AI Translator API 2025-10-01-preview, including translations using LLM models, adaptive custom translation, tone variant translations, and gender-specific translations. - Added `TranslationTarget` class for configuring translation options. ### Breaking Changes @@ -15,10 +15,6 @@ - Removed `SourceText` and `Transliteration` properties in translation responses. - Dictionary, sentence boundaries and text alignments features have been deprecated and relevant classes and properties have been removed. -### Bugs Fixed - -### Other Changes - ## 1.1.7 (2025-10-27) ### Other Changes diff --git a/sdk/translation/azure-ai-translation-text/README.md b/sdk/translation/azure-ai-translation-text/README.md index d955c4b3bb39..7ce7a0351213 100644 --- a/sdk/translation/azure-ai-translation-text/README.md +++ b/sdk/translation/azure-ai-translation-text/README.md @@ -82,7 +82,7 @@ For asynchronous operations use `TextTranslationAsyncClient`. ### Input -A **text element** (`InputTextItem`), is a single unit of input to be processed by the translation models in the Translator service. Operations on `TextTranslationClient` may take a single text element or a collection of text elements. +A **TranslateInputItem** is a single unit of input to be processed by the translation models in the Translator service. Each `TranslateInputItem` defines both the input string to translate and the output specifications for the translation. For text element length limits, maximum requests size, and supported text encoding see [here][translator_limits]. ## Examples diff --git a/sdk/webpubsub/azure-messaging-webpubsub-client/pom.xml b/sdk/webpubsub/azure-messaging-webpubsub-client/pom.xml index f02094579e35..85b3ffa241c5 100644 --- a/sdk/webpubsub/azure-messaging-webpubsub-client/pom.xml +++ b/sdk/webpubsub/azure-messaging-webpubsub-client/pom.xml @@ -55,7 +55,7 @@ io.netty netty-codec-http - 4.1.127.Final + 4.1.130.Final @@ -101,7 +101,7 @@ - io.netty:netty-codec-http:[4.1.127.Final] + io.netty:netty-codec-http:[4.1.130.Final]